Questions tagged «autofixture»

1
事实与理论之间的区别?-xUnit.net
我是xUnit.net和AutoFixture的新手。 我目前正在研究“ testproject”以熟悉xUnit.net和Autofixture。我不了解一件事。 [Fact]和之间有什么区别[Theory, AutoMoqData]? 您能否告诉我以下两个代码是否相等?我之所以这样问,是因为这两项考试都能成功完成,但是我想以正确的方式学习它。 [Fact] public void UpdateVersionWillUpdateCorrectlyInRepository() { var fixture = new Fixture().Customize(new AutoMoqCustomization()); var contract = fixture.Create<VersionContract>(); var version = fixture.Create<Version>(); fixture.Freeze<Mock<IContractMapper>>() .Setup(r => r.Map(contract)).Returns(version); var repMock = fixture.Freeze<Mock<VersionRepository>>(); var sut = fixture.Create<VersionManagementService>(); sut.UpdateVersion(contract); repMock.Verify(r => r.UpdateVersion(version)); } 和 [Theory, AutoMoqData] public void UpdateVersionWillUpdateCorrectlyInRepository( VersionContract contract, …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.