public void GivenFaxCommunicationIsBuild_WhenDeriving_ThenStatusIsSet() { var communication = new FaxCommunicationBuilder(this.Session) .WithSubject("subject") .WithOwner(new PersonBuilder(this.Session).WithLastName("owner").Build()) .WithFromParty(new PersonBuilder(this.Session).WithLastName("originator").Build()) .WithToParty(new PersonBuilder(this.Session).WithLastName("receiver").Build()) .Build(); Assert.False(this.Session.Derive(false).HasErrors); Assert.Equal(communication.CommunicationEventState, new CommunicationEventStates(this.Session).Scheduled); Assert.Equal(communication.CommunicationEventState, communication.LastCommunicationEventState); }
public void GivenFaxCommunicationIsBuild_WhenDeriving_ThenStatusIsSet() { var communication = new FaxCommunicationBuilder(this.DatabaseSession) .WithSubject("subject") .WithOwner(new PersonBuilder(this.DatabaseSession).WithLastName("owner").Build()) .WithOriginator(new PersonBuilder(this.DatabaseSession).WithLastName("originator").Build()) .WithReceiver(new PersonBuilder(this.DatabaseSession).WithLastName("receiver").Build()) .Build(); Assert.IsFalse(this.DatabaseSession.Derive().HasErrors); Assert.AreEqual(communication.CurrentCommunicationEventStatus.CommunicationEventObjectState, new CommunicationEventObjectStates(this.DatabaseSession).Scheduled); Assert.AreEqual(communication.CurrentObjectState, new CommunicationEventObjectStates(this.DatabaseSession).Scheduled); Assert.AreEqual(communication.CurrentObjectState, communication.LastObjectState); }
public void GivenFaxCommunication_WhenDeriving_ThenInvolvedPartiesAreDerived() { var owner = new PersonBuilder(this.DatabaseSession).WithLastName("owner").Build(); var originator = new PersonBuilder(this.DatabaseSession).WithLastName("originator").Build(); var receiver = new PersonBuilder(this.DatabaseSession).WithLastName("receiver").Build(); this.DatabaseSession.Derive(true); this.DatabaseSession.Commit(); var communication = new FaxCommunicationBuilder(this.DatabaseSession) .WithSubject("subject") .WithOwner(owner) .WithOriginator(originator) .WithReceiver(receiver) .Build(); this.DatabaseSession.Derive(true); Assert.AreEqual(3, communication.InvolvedParties.Count); Assert.Contains(owner, communication.InvolvedParties); Assert.Contains(originator, communication.InvolvedParties); Assert.Contains(receiver, communication.InvolvedParties); }
public void GivenFaxCommunication_WhenDeriving_ThenInvolvedPartiesAreDerived() { var owner = new PersonBuilder(this.Session).WithLastName("owner").Build(); var originator = new PersonBuilder(this.Session).WithLastName("originator").Build(); var receiver = new PersonBuilder(this.Session).WithLastName("receiver").Build(); this.Session.Derive(); this.Session.Commit(); var communication = new FaxCommunicationBuilder(this.Session) .WithSubject("subject") .WithOwner(owner) .WithFromParty(originator) .WithToParty(receiver) .Build(); this.Session.Derive(); Assert.Equal(3, communication.InvolvedParties.Count); Assert.Contains(owner, communication.InvolvedParties); Assert.Contains(originator, communication.InvolvedParties); Assert.Contains(receiver, communication.InvolvedParties); }