示例#1
0
        public void When_exception_is_thrown_in_deffered_execution_expected_exception_is_filled()
        {
            Action whenActionASync = () => { throw new AbandonedMutexException(); };

            When(whenActionASync, deferedExecution: true);
            CaughtException.Should().BeOfType <AbandonedMutexException>();
        }
示例#2
0
        public void When_exception_is_thrown_in_later_execution_expected_exception_is_filled()
        {
            Action whenActionASync = () => { throw new AbandonedMutexException(); };

            WhenLater(whenActionASync);
            CaughtException.Should().BeOfType <AbandonedMutexException>();
        }
示例#3
0
        public void When_exception_is_thrown_in_async_method_in_deffered_execution_expected_exception_is_filled()
        {
            Func <Task> whenActionASync = () => Task.Factory.StartNew(() => { throw new AbandonedMutexException(); });

            When(whenActionASync, deferedExecution: true);
            CaughtException.Should().BeOfType <AbandonedMutexException>();
        }
        public Spesification(ITestOutputHelper outputHelper)
        {
            History = Given();
            Command = When();

            var sut           = new TAggregate();
            var store         = new SpecificationAggregateStore(sut);
            var snapshotStore = new SpesificationAggregateSnapshotStore();

            try
            {
                sut.Load(History);
                GetHandler(store, snapshotStore)(Command).GetAwaiter().GetResult();
            }
            catch (Exception e)
            {
                CaughtException = e;
            }

            RaisedEvents = store.RaisedEvents;
            Snapshots    = snapshotStore.GetSnapshotAsync <TAggregate>(null, sut.Id).Result;

            if (Snapshots != null)
            {
                outputHelper.WriteLine($"Snapshot:{Snapshots.AggregateId},{Snapshots.Version}");
            }

            if (CaughtException != null)
            {
                outputHelper.WriteLine($"Error : {CaughtException.ToString()}");
            }

            Print(outputHelper);
        }
示例#5
0
        public Spesification(ITestOutputHelper outputHelper)
        {
            History = Given();
            Command = When();

            var sut   = new TAggregate();
            var store = new SpecificationAggregateStore(sut);

            try
            {
                sut.Load(History);
                GetHandler(store)(Command).GetAwaiter().GetResult();
            }
            catch (Exception e)
            {
                CaughtException = e;
            }

            RaisedEvents = store.RaisedEvents;


            if (CaughtException != null)
            {
                outputHelper.WriteLine($"Error : {CaughtException.ToString()}");
            }

            Print(outputHelper);
        }
示例#6
0
 public void Then_it_will_throw_an_unregistered_domain_event_exception()
 {
     CaughtException.WillBeOfType <UnregisteredDomainEventException>();
 }
示例#7
0
 public void it_doesnt_throw()
 {
     CaughtException.Should().BeNull();
 }
 public void The_an_exception_will_be_thrown()
 {
     CaughtException.WillBeOfType <IlligalStateAssignmentException>();
 }
示例#9
0
 public void Should_throw_ArgumentNullException()
 {
     CaughtException.Should().BeOfType <ArgumentNullException>();
 }
示例#10
0
 public void Then_a_non_existing_client_exception_will_be_thrown()
 {
     CaughtException.WillBeOfType <NonExistingClientException>();
 }
 public void The_an_exception_will_be_thrown()
 {
     CaughtException.WillBeOfType <MethodMissingException>();
 }
示例#12
0
 public void Then_it_will_not_throw_an_exception()
 {
     CaughtException.WillBeOfType <ThereWasNoExceptionButOneWasExpectedException>();
 }
示例#13
0
 public void Then_the_event_type_should_be_SomeEvent()
 {
     CaughtException.As <HandleNotFound>().EventType.Should().BeAssignableTo <NotRegisteredEvent>();
 }
示例#14
0
 public void Then_throws_an_exception()
 {
     CaughtException.Should().BeAssignableTo <HandleNotFound>();
 }
 public void review_content_is_published_but_status_is_not_pendingApprove()
 {
     CaughtException.Should().BeOfType <ReviewInvalidStatus>();
 }
 public void Then_an_account_balance_to_low_exception_will_be_thrown()
 {
     CaughtException.WillBeOfType <AccountBalanceToLowException>();
 }
 public void Then_an_account_balance_not_zero_exception_will_be_thrown()
 {
     CaughtException.WillBeOfType <AccountBalanceNotZeroException>();
 }
 public void Then_the_exception_message_will_be()
 {
     CaughtException.WithMessage(string.Format("The amount {0:C} is larger than your current balance {1:C}", 10.5M, 0));
 }
 public void Then_a_non_existing_bank_card_is_disabled_will_be_thrown()
 {
     CaughtException.WillBeOfType <BankCardIsDisabledException>();
 }
 public void Then_we_expect_an_exception_to_occure()
 {
     CaughtException.Should().BeOfType <DomainException>();
 }
示例#21
0
 public void a_EventStoreConcurrencyException_should_be_thrown() => CaughtException.ShouldBeOfType <EventStoreConcurrencyException>();
示例#22
0
 public object Any(CaughtException request)
 {
     throw new ArgumentException();
 }
示例#23
0
        public void Then_an_DomainException_should_occure()
        {
            CaughtException.Should().BeOfType <DomainException>();

            CaughtException.Message.Should().StartWith("Already contains member with id");
        }
示例#24
0
 public void Then_a_closed_account_exception_will_be_thrown()
 {
     CaughtException.WillBeOfType <ClosedAccountException>();
 }
 public void an_aggregate_not_found_exception_is_thrown() => CaughtException.ShouldBeOfType <AggregateNotFoundException>();
 public void Then_the_newly_created_account_will_be_saved()
 {
     CaughtException.WillBeOfType <UnknownAccountException>();
 }
 public void a_HostedEnvironmentConfigurationException_is_thrown() => CaughtException.ShouldBeOfType <HostedEnvironmentConfigurationException>();
 public void Then_a_non_existing_account_exception_will_be_thrown()
 {
     CaughtException.WillBeOfType <NonExitsingAccountException>();
 }
示例#29
0
 public void The_an_exception_will_be_thrown()
 {
     CaughtException.WillBeOfType <UnregisteredDomainEventException>();
 }