public void Compute_Estimator_Weighting() { var voting = new List <WeightedComparisonPairDto>() { new WeightedComparisonPairDto { Id = "1", Selection = Selection.A }, new WeightedComparisonPairDto { Id = "2", Selection = Selection.B }, new WeightedComparisonPairDto { Id = "3", Selection = Selection.B }, }; var paare = new List <ComparisonPair>() { new ComparisonPair { Id = "1", IndexA = 0, IndexB = 1 }, new ComparisonPair { Id = "2", IndexA = 0, IndexB = 2 }, new ComparisonPair { Id = "3", IndexA = 1, IndexB = 2 } }; var result = new int[0]; var sut = new Weighting(); sut.Compute_Estimator_Weighting( voting, paare, g => result = g.StoryIndizes.ToArray(), () => { throw new Exception(); } ); Assert.AreEqual(new[] { 2, 0, 1 }, result); }
public void Compute_Estimator_Weighting_Raises_Exception() { var voting = new List <WeightedComparisonPairDto>() { new WeightedComparisonPairDto { Id = "1", Selection = Selection.A }, new WeightedComparisonPairDto { Id = "2", Selection = Selection.B }, new WeightedComparisonPairDto { Id = "3", Selection = Selection.A }, }; var paare = new List <ComparisonPair>() { new ComparisonPair { Id = "1", IndexA = 0, IndexB = 1 }, new ComparisonPair { Id = "2", IndexA = 0, IndexB = 2 }, new ComparisonPair { Id = "3", IndexA = 1, IndexB = 2 } }; var sut = new Weighting(); sut.Compute_Estimator_Weighting( voting, paare, g => { throw new Exception("kein Fehler"); }, () => Assert.True(true) ); }