public void Context()
        {
            var container = Stub<IContainer>();
            container.Stub(x => x.ResolveAll<IDomainEventHandler<TestDomainEvent>>()).Return(new IDomainEventHandler<TestDomainEvent>[0]);
            IoC.Initialize(container);

            _exception = Should.Throw<CoreException>(() => DomainEvents.RaiseEvent(new TestDomainEvent()));
        }
 public void Context()
 {
     _template = EmailTemplateBuilder.New
         .WithInitialHtml("123")
         .WithVariable(1, 1)
         .Build();
     var htmlPartId = _template.Parts.Last().Id;
     _exception = Should.Throw<CoreException>(() => _template.DeleteVariable(htmlPartId));
 }
 public void Context()
 {
     var template = EmailTemplateBuilder.New.Build();
     var state = Stub<EmailState>();
     state.Stub(a => a.CanSend).Return(false);
     state.Stub(a => a.Name).Return("state");
     _email = new EmailBuilder()
         .WithEmailTemplate(template)
         .WithState(state)
         .Build();
     _exception = Should.Throw<CoreException>(() => _email.EnqueueEmailToBeSent(FromAddress, null, Subject));
 }
 public void Context()
 {
     var template = EmailTemplateBuilder.New
         .WithId(45)
         .WithInitialHtml("12345")
         .Build();
     var emailTemplateDto = new EmailTemplateDto
                                {
                                    EmailTemplateId = 66,
                                };
     _exception = Should.Throw<CoreException>(() => template.Update(emailTemplateDto));
 }
        public void Context()
        {
            var template = EmailTemplateBuilder.New.Build();
            var state = MockRepository.GenerateMock<EmailState>();
            state.Stub(a => a.CanSend).Return(true);
            var email = new EmailBuilder()
                .WithEmailTemplate(template)
                .WithState(state)
                .WithRecipient(new Recipient("email", "name"))
                .Build();

            _exception = Should.Throw<CoreException>(() => email.EnqueueEmailToBeSent(null, null, null));
        }
 public void Context()
 {
     var template = EmailTemplateBuilder.New
         .WithInitialHtml("12345")
         .Build();
     const int emailId = 78;
     var email = new EmailBuilder()
         .WithId(56)
         .WithEmailTemplate(template)
         .Build();
     var emailDto = new EmailDto {EmailId = emailId};
     _exception = Should.Throw<CoreException>(() => email.UpdateVariables(emailDto));
 }
 public void Context()
 {
     _template = EmailTemplateBuilder.New.Build();
     _exception = Should.Throw<CoreException>(() => _template.DeleteVariable(23));
 }
 public void Context()
 {
     var user = UserBuilder.New.Build();
     _exception = Should.Throw<CoreException>(() => user.ChangePassword("incorrect old password", "new password"));
 }