Exemplo n.º 1
0
        public void TestRegisterTransferredAttendee_AlreadyRegistered()
        {
            var attendee = CreateAttendee("John", "Doe");
            var originalOccurrence = new EventOccurrence() { Id = 1, Event = new Event() { Title = "Test event 1" } };
            originalOccurrence.RegisterAttendee(_registration, attendee, 5M,false);
            var originalEventOccurrenceAttendee = originalOccurrence.EventOccurrenceAttendees.ElementAt(0);
            var newOccurrence = new EventOccurrence() { Id = 2, Event = new Event() { Title = "Test event 2" } };
            newOccurrence.RegisterAttendee(_registration, attendee, 0M, false);

            newOccurrence.RegisterTransferredAttendee(originalEventOccurrenceAttendee);
        }
Exemplo n.º 2
0
        public void TestRegisterTransferredAttendee()
        {
            var attendee = CreateAttendee("John", "Doe");
            var originalOccurrence = new EventOccurrence() { Id = 1 };
            originalOccurrence.RegisterAttendee(_registration, attendee, 5M, false);
            var originalEventOccurrenceAttendee = originalOccurrence.EventOccurrenceAttendees.ElementAt(0);

            var newOccurrence = new EventOccurrence() { Id = 2 };
            newOccurrence.RegisterTransferredAttendee(originalEventOccurrenceAttendee);

            Assert.AreEqual(1, newOccurrence.EventOccurrenceAttendees.Count());
            var newEventOccurrenceAttendee = newOccurrence.EventOccurrenceAttendees.ElementAt(0);

            Assert.AreEqual(attendee, newEventOccurrenceAttendee.Attendee);
            Assert.AreEqual(_registration, newEventOccurrenceAttendee.EventRegistration);
            Assert.AreEqual(5M, newEventOccurrenceAttendee.AmountPaid);
        }