コード例 #1
0
 public void RemoveInvitation_PostiveTest()
 {
     invitationCollection = GetEmptyInviteCollection();
     invitationCollection.AddInvitation(invitation, customer);
     invitationCollection.RemoveInvitation(invitation);
     Assert.AreEqual(invitationCollection.Count(), 0);
 }
コード例 #2
0
        public void GetInvitationById_NegativeTest()
        {
            invitationCollection = GetEmptyInviteCollection();
            invitationCollection.AddInvitation(invitation, customer);
            var id     = Guid.NewGuid().ToString();
            var invite = invitationCollection.GetInvitationById(id);

            Assert.IsNull(invite);
        }
コード例 #3
0
        public void GetInvitationById_PostiveTest()
        {
            invitationCollection = GetEmptyInviteCollection();
            invitationCollection.AddInvitation(invitation, customer);
            var id     = invitation.InvitationId;
            var invite = (Invitation)invitationCollection.GetInvitationById(id);

            Assert.AreEqual(id, invite.InvitationId);
        }
コード例 #4
0
        public void RemoveInvitation_NegativeTest1()
        {
            invitationCollection = GetEmptyInviteCollection();
            var invitation        = new Mock <IInvitation>();
            var expectedException = false;
            var exceptionType     = string.Empty;

            try
            {
                invitationCollection.AddInvitation(invitation.Object, customer);
            }
            catch (ArgumentNullException)
            {
                expectedException = true;
            }
            catch (Exception e)
            {
                exceptionType = e.GetType().ToString();
            }
            Assert.IsTrue(expectedException, string.Format("Expected excption not got, got {0} instead", exceptionType));
        }
コード例 #5
0
 public void AddInvitation_PositiveTest1()
 {
     invitationCollection = GetEmptyInviteCollection();
     invitationCollection.AddInvitation(invitation, customer);
     Assert.AreEqual(invitationCollection.Count(), 1);
 }