Ejemplo n.º 1
0
 public void Subject_is_not_generated_by_nsubstitute()
 {
     When(() => Subject.Received().DoSomething(), deferedExecution: true);
     WhenAction.ShouldThrow <NotASubstituteException>();
 }
Ejemplo n.º 2
0
 public void Then_it_should_include_the_current_event_into_the_projection_exception()
 {
     WhenAction.ShouldThrow <ProjectionException>().Which.CurrentEvent.Should().Be(The <EventEnvelope>());
 }
Ejemplo n.º 3
0
 public void Then_it_should_include_the_current_transaction_batch_into_the_projection_exception()
 {
     WhenAction.ShouldThrow <ProjectionException>().Which.TransactionBatch.Should().BeEquivalentTo(The <Transaction>());
 }
Ejemplo n.º 4
0
 public void Then_the_exception_should_be_observed()
 {
     WhenAction.ShouldThrow <ApplicationException>();
 }
Ejemplo n.º 5
0
 public void Then_it_should_wrap_the_exception_into_a_projection_exception()
 {
     WhenAction.ShouldThrow <ProjectionException>()
     .Which.InnerException.Should().BeSameAs(The <InvalidOperationException>());
 }
Ejemplo n.º 6
0
 public void Then_an_argument_exception_should_be_thrown()
 {
     WhenAction.ShouldThrow <ArgumentException>().WithMessage("No customer with id 12");
 }
Ejemplo 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>();
 }
Ejemplo n.º 8
0
 public void Then_it_should_throw()
 {
     WhenAction.ShouldThrow <ProjectionException>();
 }
Ejemplo 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());
 }
Ejemplo n.º 10
0
 public void When_executing_later_then_whenaction_can_be_used_to_test_for_exceptions()
 {
     WhenLater(() => { throw new AbandonedMutexException(); });
     WhenAction.ShouldThrow <AbandonedMutexException>();
 }