public void GivenFaceToFaceCommunication_WhenConfirmed_ThenCurrentCommunicationEventStatusMustBeDerived() { var communication = new FaceToFaceCommunicationBuilder(this.Session) .WithOwner(new PersonBuilder(this.Session).WithLastName("owner").Build()) .WithFromParty(new PersonBuilder(this.Session).WithLastName("participant1").Build()) .WithToParty(new PersonBuilder(this.Session).WithLastName("participant2").Build()) .WithSubject("Hello") .WithActualStart(this.Session.Now()) .Build(); this.Session.Derive(); Assert.Equal(new CommunicationEventStates(this.Session).InProgress, communication.CommunicationEventState); communication.Close(); this.Session.Derive(); Assert.Equal(new CommunicationEventStates(this.Session).Completed, communication.CommunicationEventState); }
public void GivenFaceToFaceCommunication_WhenConfirmed_ThenCurrentCommunicationEventStatusMustBeDerived() { var communication = new FaceToFaceCommunicationBuilder(this.DatabaseSession) .WithParticipant(new PersonBuilder(this.DatabaseSession).WithLastName("participant1").Build()) .WithParticipant(new PersonBuilder(this.DatabaseSession).WithLastName("participant2").Build()) .WithSubject("Hello") .WithActualStart(DateTime.UtcNow) .Build(); this.DatabaseSession.Derive(true); Assert.AreEqual(1, communication.CommunicationEventStatuses.Count); Assert.AreEqual(new CommunicationEventObjectStates(this.DatabaseSession).InProgress, communication.CurrentCommunicationEventStatus.CommunicationEventObjectState); communication.Close(); this.DatabaseSession.Derive(true); Assert.AreEqual(2, communication.CommunicationEventStatuses.Count); Assert.AreEqual(new CommunicationEventObjectStates(this.DatabaseSession).Completed, communication.CurrentCommunicationEventStatus.CommunicationEventObjectState); }