Beispiel #1
0
        public void GetParticipantEmailDB_WithInvalidInput_SuccesIsFalse()
        {
            uut = new ManageParticipantHandler(mockContext.Object);
            var dbrecept = uut.GetParticipantEmailDB(10);

            Assert.IsFalse(dbrecept.success);
        }
Beispiel #2
0
        public void GetParticipantEmailDB_WithInvalidInput_EmailIsNotCorrect()
        {
            uut = new ManageParticipantHandler(mockContext.Object);
            var dbrecept = uut.GetParticipantEmailDB(10);

            Assert.AreNotEqual(dbrecept.participantEmail, "*****@*****.**");
        }
Beispiel #3
0
        public void GetParticipantsInStudyDB_WithhValidInput_ResulstIsCorrect()
        {
            uut = new ManageParticipantHandler(mockContext.Object);
            var partList = uut.GetParticipantsInStudyDB(1);

            Assert.AreEqual(partList[0].Email, "*****@*****.**");
        }
Beispiel #4
0
        public void GetParticipantsInStudyDB_WithInvalidInput_ResulstIsNotCorrect()
        {
            uut = new ManageParticipantHandler(mockContext.Object);
            var partList = uut.GetParticipantsInStudyDB(10);

            Assert.That(partList.Count == 0);
        }
Beispiel #5
0
        public void RemoveParticipantFromStudyDB_WithInvalidInput_SuccesIsFalse()
        {
            uut = new ManageParticipantHandler(mockContext.Object);
            var dbrecept = uut.RemoveParticipantFromStudyDB(10, 1);

            Assert.IsFalse(dbrecept.success);
        }
Beispiel #6
0
        public void RemoveParticipantFromStudyDB_WithInvalidInput_Participantisnotenrolledinstudy()
        {
            uut = new ManageParticipantHandler(mockContext.Object);
            var dbrecept = uut.RemoveParticipantFromStudyDB(10, 1);

            Assert.AreEqual(dbrecept.errormessage, "Participant is not enrolled in study");
        }
Beispiel #7
0
        public void AddParticipantToStudyDB_WithValidInput_Participantallreadyenrolledinstudy()
        {
            //mockContext.Object.Participant.Add(participants[0]);
            uut = new ManageParticipantHandler(mockContext.Object);
            var dbrecept = uut.AddParticipantToStudyDB(1, 1);

            Assert.AreEqual(dbrecept.errormessage, "Participant is already enrolled instudy.");
        }
Beispiel #8
0
        public void AddParticipantToStudyDB_WithValidInput_ParticipantIDdoesnotexistinthesystem()
        {
            //mockContext.Object.Participant.Add(participants[0]);
            uut = new ManageParticipantHandler(mockContext.Object);
            var dbrecept = uut.AddParticipantToStudyDB(2, 5);

            Assert.AreEqual(dbrecept.errormessage, "Participant with this ID does not exist in the system");
        }
Beispiel #9
0
        public void AddParticipantToStudyDB_WithValidInput_SuccesIsFalse()
        {
            //mockContext.Object.Participant.Add(participants[0]);
            uut = new ManageParticipantHandler(mockContext.Object);
            var dbrecept = uut.AddParticipantToStudyDB(2, 5);

            Assert.False(dbrecept.success);
        }