예제 #1
0
        public void AddSponsor_should_return_a_MeetingSponsor_typed_Object()
        {
            // Arrange
            var meeting = new Meeting();

            // Act
            var returnMeetingSponsor = meeting.AddSponsor(new Sponsor());

            // Assert
            Assert.That(returnMeetingSponsor, Is.TypeOf(typeof(MeetingSponsor)));
        }
예제 #2
0
        public void AddSponsor_should_allow_a_type_of_sponsor_to_be_added()
        {
            // Arrange
            var meeting = new Meeting();

            // Act
            var returnMeetingSponsor = meeting.AddSponsor(new Sponsor(), SponsorType.Food);

            // Assert
            Assert.That(returnMeetingSponsor, Is.TypeOf(typeof(MeetingSponsor)));
            Assert.That(returnMeetingSponsor.Type, Is.EqualTo(SponsorType.Food));
        }
예제 #3
0
        public void AddSponsor_should_increment_the_sponsor_quantity()
        {
            // Arrange
            var meeting = new Meeting();

            // Act
            meeting.AddSponsor(new Sponsor());

            // Assert
            Assert.That(meeting.Sponsors.Count, Is.EqualTo(1));
        }
예제 #4
0
        public void Update_on_Meeting_should_not_overwrite_attendees()
        {
            var repository = GetMeetingRepository();

            var meeting = new Meeting {Description = "next meeting", Title = "Title"};

            meeting.AddSponsor(new Sponsor {Description = "sweet", Name = "J&P Cycles"});
            meeting.AddAttendee(new Member{Email = "*****@*****.**"});

            var meetingId = repository.Add(meeting);

            var savedMeeting = repository.GetById(meetingId);

            meeting.AddGuestAttendee("*****@*****.**", "chris", "missal");

            repository.Update(meeting);

            var countBeforeUpdate = meeting.AttendeeCount;

            repository.Update(savedMeeting);

            Assert.That(savedMeeting.AttendeeCount, Is.EqualTo(countBeforeUpdate));
        }