public void WithArgument_NullArrayForTwoArguments_ArgumentNullExceptionThrown() { // Arrange var context = new ContractTestContext <int, int>("", (a, b) => { }); // Action & Assert Assert.ThrowsException <ArgumentNullException>(() => context.WithArguments(null)); }
public void WithArgument_EmptyArray_ArgumentExceptionThrown() { // Arrange var context = new ContractTestContext <int>("", a => { }); // Action & Assert Assert.ThrowsException <ArgumentException>(() => context.WithArguments()); }
public void WithArgument_NullAsSingleArgument_TestCaseCreated() { // Arrange var context = new ContractTestContext <int>("", a => { }); // Action context.WithArguments(null); // Assert var cases = ContractTest.Method.Current; Assert.AreEqual(1, cases.Count); }
public void WithArgument_NullAsSingleArgumentForFormattedContract_TestCaseContractFormattedNull() { // Arrange var context = new ContractTestContext <string>("{0} is my money", a => { }); // Action context.WithArguments(null); // Assert var cases = ContractTest.Method.Current; var contract = cases[0].DisplayName; Assert.AreEqual("Null is my money", contract); }
public void WithArgument_NullAsSingleArgument_TestCaseContractAppendNull() { // Arrange var context = new ContractTestContext <string>("My money is ", a => { }); // Action context.WithArguments(null); // Assert var cases = ContractTest.Method.Current; var contract = cases[0].DisplayName; Assert.AreEqual("My money is (Null)", contract); }
public void WithArgument_GetUnitTestResult_TestCaseExecuted() { // Arrange var executed = false; var context = new ContractTestContext <int>("", a => executed = true); // Action context.WithArguments(0); var result = ContractTest.Method.Current.Single().Result; // Assert Assert.IsNotNull(result); Assert.IsTrue(executed); }