public void NormalizeTests(int expectedDenominator, params int[] denominators) { List <Weighting> set = denominators.Select(x => Weighting.Create(1, (ulong)x).Value).ToList(); ICollection <Weighting> result = Weighting.Normalize(set); result.All(x => x.Denominator == (ulong)expectedDenominator).Should().BeTrue(); }
public void SimplifyTests(int top, int bottom, int expectedTop, int expectedBottom) { Weighting weighting = Weighting.Create((ulong)top, (ulong)bottom).Value; Weighting result = weighting.Simplify(); result.Numerator.Should().Be((ulong)expectedTop); result.Denominator.Should().Be((ulong)expectedBottom); }