Esempio n. 1
0
        public Meeting Schedule(Id meetingId, MeetingDate on, Id venue, Id speaker, Capacity capacity)
        {
            if (on == null)
                throw new ArgumentNullException("on", "A meeting must have a date to be scheduled");

            var tickets = _overbookingPolicy.AllocateTickets(capacity);

            var meeting = new Meeting(meetingDate: on, venue: venue, speaker: speaker, tickets: tickets, version: new Version(), id: meetingId);
            meeting.OpenForRegistration();
            return meeting;
        }
        public void GivenIHaveASpeaker(string speakerName)
        {
            using (var uow = container.Resolve<IAmAUnitOfWorkFactory>().CreateUnitOfWork())
            {
                speakerId = new Id(Guid.NewGuid());
                uow.Add(new SpeakerDTO(
                            speakerId,
                            new Version(),
                            new SpeakerBio("Augusta Ada King, Countess of Lovelace (10 December 1815 – 27 November 1852), born Augusta Ada Byron, was an English writer chiefly known for her work on Charles Babbage's early mechanical general-purpose computer, the analytical engine."),
                            new PhoneNumber("888-888-8888"),
                            new EmailAddress("*****@*****.**"),
                            new Name("Augusta Ada King, Countess of Lovelace")));
                uow.Commit();
            }

            scheduleMeetingCommand.SpeakerId = speakerId;
        }
Esempio n. 3
0
 public bool Equals(Id other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.id.Equals(id);
 }
 public void GivenIHaveAVenue(string venueName)
 {
     using (var uow = container.Resolve<IAmAUnitOfWorkFactory>().CreateUnitOfWork())
     {
         venueId = new Id(Guid.NewGuid());
         var venue = new VenueDTO(
             venueId,
             new Version(),
             new VenueName("The American Bar, The Savoy Hotel"),
             new Address(new Street("The Strand"), new City("London"), new PostCode("WC2R 0EU")),
             new VenueMap(new Uri("http://www.fairmont.com/savoy/MapAndDirections.htm")),
             new VenueContact(new ContactName("Athena Cripps"), new EmailAddress("*****@*****.**"), new PhoneNumber(" +44 (0)20 7420 2492")));
         uow.Add(venue);
         uow.Commit();
     }
     scheduleMeetingCommand.VenueId = venueId;
 }