コード例 #1
0
 public void TestConstructor_UnknownParticipantTypeId()
 {
     var user              = new User(1);
     var projectId         = 10;
     var participantTypeId = -1;
     var instance          = new TestAdditionalProjectParticipant(user, projectId, participantTypeId);
 }
コード例 #2
0
        public void TestConstructor()
        {
            var user              = new User(1);
            var projectId         = 10;
            var participantTypeId = ParticipantType.Individual.Id;
            var instance          = new TestAdditionalProjectParticipant(user, projectId, participantTypeId);

            Assert.IsTrue(Object.ReferenceEquals(user, instance.Audit.User));
            Assert.AreEqual(projectId, instance.ProjectId);
            Assert.AreEqual(participantTypeId, instance.ParticipantTypeId);
        }
コード例 #3
0
        public void TestUpdateParticipant()
        {
            var user              = new User(1);
            var projectId         = 10;
            var participantTypeId = ParticipantType.Individual.Id;
            var instance          = new TestAdditionalProjectParticipant(user, projectId, participantTypeId);
            var participant       = new Participant();
            var participantType   = new ParticipantType
            {
                ParticipantTypeId = ParticipantType.ForeignNonTravelingParticipant.Id,
                Name = ParticipantType.ForeignNonTravelingParticipant.Value
            };

            Assert.IsFalse(instance.UpdateParticipantDetailsCalled);
            instance.UpdateParticipant(participant, participantType, null, null);
            Assert.IsTrue(instance.UpdateParticipantDetailsCalled);
            Assert.AreEqual(participantType.ParticipantTypeId, participant.ParticipantTypeId);
            Assert.AreEqual(ParticipantStatus.Active.Id, participant.ParticipantStatusId);
            Assert.AreEqual(projectId, participant.ProjectId);
        }