public void SameValues_RemainIntact() { var input = GeneratePowers(100, () => 101, () => 101); var expected = (Power[])input.Clone(); var sut = new PowersSorter(); sut.Sort(input); input.Should().Equal(expected); }
public void SameBase_ExponentsGrow() { var random = new Random(12345); var input = GeneratePowers(100, () => 999, () => random.Next(100, 10000)); var sut = new PowersSorter(); sut.Sort(input); input.Select(x => x.Exponent).Should().BeInAscendingOrder(); }
public void RandomSmallInput_VerifiesAccuratelly() { var random = new Random(12345); var input = GeneratePowers(100, () => random.Next(2, 8), () => random.Next(2, 8)); var copy = input.ComputePowers().ToArray(); Array.Sort(copy); var sut = new PowersSorter(); sut.Sort(input); input.ComputePowers().ShouldAllBeEquivalentTo(copy); }
public void EmptySet_DoesNotFail() { var sut = new PowersSorter(); sut.Sort(new Power[] { }); }