- 授权协议: MIT
- 开发语言: C#
- 操作系统: Windows
- 软件首页: https://github.com/AutoFixture/AutoFixture
- 软件文档: https://github.com/AutoFixture/AutoFixture
软件介绍
AutoFixture 是一个 .NET 的开源框架,主要设计目的是最小化单元测试的‘安排’阶段。可以让开发者把重点放在测试的目标而不是设置测试场景。
示例代码:
[TestMethod]
public void IntroductoryTest()
{
// Fixture setup
Fixture fixture = new Fixture();
int expectedNumber = fixture.Create<int>();
MyClass sut = fixture.Create<MyClass>();
// Exercise system
int result = sut.Echo(expectedNumber);
// Verify outcome
Assert.AreEqual<int>(expectedNumber, result, "Echo");
// Teardown
}
