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))); }
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)); }
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)); }
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)); }