public void NumberSumIsCorrect_DerivedFixture() { // Arrange MyClassFixture fixture = new MyClassFixture(); fixture.AddManyTo(fixture.Things); int expectedSum = fixture.Things.Select(t => t.Number).Sum(); MyClass sut = fixture.Create <MyClass>(); // Act int result = sut.CalculateSumOfThings(); // Assert Assert.Equal <int>(expectedSum, result); }
public void NumberSumIsCorrect_DerivedFixture() { // Fixture setup MyClassFixture fixture = new MyClassFixture(); fixture.AddManyTo(fixture.Things); int expectedSum = fixture.Things.Select(t => t.Number).Sum(); MyClass sut = fixture.Create <MyClass>(); // Exercise system int result = sut.CalculateSumOfThings(); // Verify outcome Assert.Equal <int>(expectedSum, result); // Teardown }