public void TestConstructor_UnknownParticipantTypeId() { var user = new User(1); var projectId = 10; var participantTypeId = -1; var instance = new TestAdditionalProjectParticipant(user, projectId, participantTypeId); }
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); }
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); }