Esempio n. 1
0
 public async Task I_can_assert_a_derived_async_exception_and_get_no_error_if_derived_exception_was_thrown()
 {
     await SutAssert.ThrowsAsync <IOException>(() => Task.FromException(new FileNotFoundException()), true);
 }
Esempio n. 2
0
 public async Task I_can_assert_an_async_exception_and_get_an_error_if_no_exception_was_thrown()
 {
     await Assert.ThrowsAsync <AssertionException>(
         () => SutAssert.ThrowsAsync <IOException>(() => Task.CompletedTask)
         );
 }
Esempio n. 3
0
 public async Task I_can_assert_an_async_exception_and_get_an_error_if_another_was_thrown()
 {
     await Assert.ThrowsAsync <AssertionException>(
         () => SutAssert.ThrowsAsync <IOException>(() => Task.FromException(new FileNotFoundException()))
         );
 }
Esempio n. 4
0
 public async Task I_can_assert_an_async_exception_and_get_no_error_if_the_expected_exception_is_thrown()
 {
     await SutAssert.ThrowsAsync <IOException>(() => Task.FromException(new IOException()));
 }
Esempio n. 5
0
 public void I_can_assert_an_exception_and_get_an_error_if_no_exception_was_thrown()
 {
     Assert.Throws <AssertionException>(
         () => SutAssert.Throws <IOException>(() => {})
         );
 }
Esempio n. 6
0
 public void I_can_assert_a_condition_and_get_an_error_if_it_is_false()
 {
     Assert.Throws <AssertionException>(
         () => SutAssert.That(false)
         );
 }
Esempio n. 7
0
 public void I_can_assert_a_condition_and_get_no_error_if_it_is_true()
 {
     SutAssert.That(true);
 }
Esempio n. 8
0
 public void I_can_manually_report_assertion_failure()
 {
     Assert.Throws <AssertionException>(() => SutAssert.Fail("Test"));
 }