@Test public void shouldWeightGood_forOneBarPriorMatch(){ HarmonicLoop barTooWeight = new HarmonicLoop(); barTooWeight.setId(1); oneBarLoop = new HarmonicLoop(); oneBarLoop.setId(1); onePriorProgBar.setHarmonicLoopAlt(oneBarLoop); twoBarsLoop = new HarmonicLoop(); twoBarsLoop.setId(2); twoPrioProgBar.setHarmonicLoopAlt(twoBarsLoop); WeightClass result = harmonicAltThemeWeighter.calculateThemeWeight(barTooWeight, onePriorProgBar, twoPrioProgBar); assertThat(result).isEqualTo(WeightClass.GOOD); }
public WeightClass calculateThemeWeight(HarmonicLoop optionToWeight, ProgressionUnitBar oneBarPrior, ProgressionUnitBar secondBarPrior){ WeightClass weightClass = WeightClass.BAD; if(secondBarPrior != null && secondBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(secondBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.OK; } if(oneBarPrior != null && oneBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(oneBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.GOOD; } return weightClass; }
HarmonicAltThemeWeighter { public WeightClass calculateThemeWeight(HarmonicLoop optionToWeight, ProgressionUnitBar oneBarPrior, ProgressionUnitBar secondBarPrior){ WeightClass weightClass = WeightClass.BAD; if(secondBarPrior != null && secondBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(secondBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.OK; } if(oneBarPrior != null && oneBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(oneBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.GOOD; } return weightClass; } }
HarmonicAltThemeWeighter { public WeightClass calculateThemeWeight(HarmonicLoop optionToWeight, ProgressionUnitBar oneBarPrior, ProgressionUnitBar secondBarPrior){ WeightClass weightClass = WeightClass.BAD; if(secondBarPrior != null && secondBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(secondBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.OK; } if(oneBarPrior != null && oneBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(oneBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.GOOD; } return weightClass; }  }
HarmonicAltThemeWeighter { public WeightClass calculateThemeWeight(HarmonicLoop optionToWeight, ProgressionUnitBar oneBarPrior, ProgressionUnitBar secondBarPrior){ WeightClass weightClass = WeightClass.BAD; if(secondBarPrior != null && secondBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(secondBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.OK; } if(oneBarPrior != null && oneBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(oneBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.GOOD; } return weightClass; }  WeightClass calculateThemeWeight(HarmonicLoop optionToWeight, ProgressionUnitBar oneBarPrior, ProgressionUnitBar secondBarPrior); }
HarmonicAltThemeWeighter { public WeightClass calculateThemeWeight(HarmonicLoop optionToWeight, ProgressionUnitBar oneBarPrior, ProgressionUnitBar secondBarPrior){ WeightClass weightClass = WeightClass.BAD; if(secondBarPrior != null && secondBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(secondBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.OK; } if(oneBarPrior != null && oneBarPrior.getHarmonicLoopAlt() != null && optionToWeight.getId().equals(oneBarPrior.getHarmonicLoopAlt().getId())){ weightClass = WeightClass.GOOD; } return weightClass; }  WeightClass calculateThemeWeight(HarmonicLoop optionToWeight, ProgressionUnitBar oneBarPrior, ProgressionUnitBar secondBarPrior);  }