public void Setup()
 {
     _id = Guid.NewGuid();
     _name = "Joe";
     _email = "UserID";
     _accLead = new AccommodationLead(_id, _name, _email);
     _accLead.MarkChangesAsCommitted();
     _accLead.Approve();
 }
        public void ShouldPublishAnAccommodationLeadApprovedEvent()
        {
            const string name = "joe";
            const string email = "*****@*****.**";

            var accLeadId = Guid.NewGuid();
            var accommodationLead = new AccommodationLead(accLeadId, name, email);

            Test.Initialize();
            Test.Handler(bus =>
                {
                    var domainRepository = CreateDomainRepository(bus);
                    domainRepository.Save(accommodationLead);
                    return new Processors.ApproveAccLead(domainRepository);
                })
                .ExpectPublish<AccommodationLeadApproved>(approved => approved.AccLeadId == accLeadId &&
                                                                      approved.Name == name &&
                                                                      approved.Email == email)
                .OnMessage<ApproveAccLead>(lead => { lead.AccLeadId = accLeadId; });
        }
 public void Setup()
 {
     _id = Guid.NewGuid();
     _name = "Joe";
     _email = "*****@*****.**";
     _accLead = new AccommodationLead(_id, _name, _email);
 }
 public void ShouldClearOutstandingEventsWhenChangesAreMarkedAsCommitted()
 {
     var accLead = new AccommodationLead(Guid.NewGuid(), String.Empty, String.Empty);
     accLead.MarkChangesAsCommitted();
     Assert.That(accLead.OutstandingEvents.Count, Is.EqualTo(0));
 }