Esempio n. 1
0
 public void Subject_is_not_generated_by_nsubstitute()
 {
     When(() => Subject.Received().DoSomething(), deferedExecution: true);
     WhenAction.ShouldThrow <NotASubstituteException>();
 }
 public void Then_it_should_include_the_current_event_into_the_projection_exception()
 {
     WhenAction.ShouldThrow <ProjectionException>().Which.CurrentEvent.Should().Be(The <EventEnvelope>());
 }
 public void Then_it_should_include_the_current_transaction_batch_into_the_projection_exception()
 {
     WhenAction.ShouldThrow <ProjectionException>().Which.TransactionBatch.Should().BeEquivalentTo(The <Transaction>());
 }
Esempio n. 4
0
 public void Then_the_exception_should_be_observed()
 {
     WhenAction.ShouldThrow <ApplicationException>();
 }
 public void Then_it_should_wrap_the_exception_into_a_projection_exception()
 {
     WhenAction.ShouldThrow <ProjectionException>()
     .Which.InnerException.Should().BeSameAs(The <InvalidOperationException>());
 }
Esempio n. 6
0
 public void Then_an_argument_exception_should_be_thrown()
 {
     WhenAction.ShouldThrow <ArgumentException>().WithMessage("No customer with id 12");
 }
Esempio n. 7
0
 public void When_deffering_execution_then_whenaction_can_be_used_to_test_for_exceptions()
 {
     When(() => { throw new AbandonedMutexException(); }, deferedExecution: true);
     WhenAction.ShouldThrow <AbandonedMutexException>();
 }
Esempio n. 8
0
 public void Then_it_should_throw()
 {
     WhenAction.ShouldThrow <ProjectionException>();
 }
Esempio n. 9
0
 public void Then_it_should_identify_the_projector_via_the_projection_type()
 {
     WhenAction.ShouldThrow <ProjectionException>()
     .Which.Projector.Should().Be(typeof(ProductCatalogEntry).ToString());
 }
Esempio n. 10
0
 public void When_executing_later_then_whenaction_can_be_used_to_test_for_exceptions()
 {
     WhenLater(() => { throw new AbandonedMutexException(); });
     WhenAction.ShouldThrow <AbandonedMutexException>();
 }