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 }
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.CreateAnonymous <MyClass>(); // Exercise system int result = sut.CalculateSumOfThings(); // Verify outcome Assert.Equal <int>(expectedSum, result); // Teardown }