AnalysedPatientReporter { @NotNull @VisibleForTesting static String determineForNumber(@NotNull PurpleAnalysis purpleAnalysis) { return purpleAnalysis.hasReliablePurity() && purpleAnalysis.purity() > ReportResources.PURITY_CUTOFF ? QsFormNumber.FOR_080.display() : QsFormNumber.FOR_209.display(); } AnalysedPatientReporter(@NotNull final AnalysedReportData reportData);   }
@Test public void canDetermineForNumber() { double purityCorrect = 0.40; boolean hasReliablePurityCorrect = true; PurpleAnalysis purpleAnalysisCorrect = ImmutablePurpleAnalysis.builder() .purity(purityCorrect) .hasReliablePurity(hasReliablePurityCorrect) .hasReliableQuality(true) .ploidy(1.00) .exomeGeneCopyNumbers(Lists.newArrayList()) .reportableGainsAndLosses(Lists.newArrayList()) .purpleSignatures(ImmutablePurpleSignatures.builder() .microsatelliteIndelsPerMb(0.00) .microsatelliteStatus(MicrosatelliteStatus.MSS) .tumorMutationalBurdenPerMb(4.00) .tumorMutationalLoad(100) .tumorMutationalLoadStatus(TumorMutationalStatus.LOW) .build()) .evidenceItems(Lists.newArrayList()) .build(); assertEquals(QsFormNumber.FOR_080.display(), AnalysedPatientReporter.determineForNumber(purpleAnalysisCorrect)); double purityNotCorrect = 0.10; boolean hasReliablePurityNotCorrect = false; PurpleAnalysis purpleAnalysisNotCorrect = ImmutablePurpleAnalysis.builder() .purity(purityNotCorrect) .hasReliablePurity(hasReliablePurityNotCorrect) .hasReliableQuality(true) .ploidy(1.00) .exomeGeneCopyNumbers(Lists.newArrayList()) .reportableGainsAndLosses(Lists.newArrayList()) .purpleSignatures(ImmutablePurpleSignatures.builder() .microsatelliteIndelsPerMb(0.00) .microsatelliteStatus(MicrosatelliteStatus.MSS) .tumorMutationalBurdenPerMb(4.00) .tumorMutationalLoad(100) .tumorMutationalLoadStatus(TumorMutationalStatus.LOW) .build()) .evidenceItems(Lists.newArrayList()) .build(); assertEquals(QsFormNumber.FOR_209.display(), AnalysedPatientReporter.determineForNumber(purpleAnalysisNotCorrect)); }