Exemple #1
0
        public void GivenCustomerShipment_WhenBuild_ThenPreviousObjectStateIsNull()
        {
            var workEffort = new ActivityBuilder(this.DatabaseSession).WithDescription("Activity").Build();

            this.DatabaseSession.Derive(true);

            Assert.IsNull(workEffort.PreviousObjectState);
        }
Exemple #2
0
        public void GivenCustomerShipment_WhenBuild_ThenLastObjectStateEqualsCurrencObjectState()
        {
            var workEffort = new ActivityBuilder(this.DatabaseSession).WithDescription("Activity").Build();

            this.DatabaseSession.Derive(true);

            Assert.AreEqual(new WorkEffortObjectStates(this.DatabaseSession).NeedsAction, workEffort.CurrentObjectState);
            Assert.AreEqual(workEffort.LastObjectState, workEffort.CurrentObjectState);
        }
 public static void SetOriginalActivityBuilder(object instance, ActivityBuilder originalActivityBuilder)
 {
     if (originalActivityBuilder != null)
     {
         AttachablePropertyServices.SetProperty(instance, originalActivityBuilderProperty, originalActivityBuilder);
     }
     else
     {
         AttachablePropertyServices.RemoveProperty(instance, originalActivityBuilderProperty);
     }
 }
Exemple #4
0
        public void GivenCustomerShipment_WhenConfirmed_ThenCurrentShipmentStatusMustBeDerived()
        {
            var workEffort = new ActivityBuilder(this.DatabaseSession).WithDescription("Activity").Build();

            this.DatabaseSession.Derive(true);

            Assert.AreEqual(1, workEffort.WorkEffortStatuses.Count);
            Assert.AreEqual(new WorkEffortObjectStates(this.DatabaseSession).NeedsAction, workEffort.CurrentWorkEffortStatus.WorkEffortObjectState);

            workEffort.Finish();

            this.DatabaseSession.Derive(true);

            Assert.AreEqual(2, workEffort.WorkEffortStatuses.Count);
            Assert.AreEqual(new WorkEffortObjectStates(this.DatabaseSession).Completed, workEffort.CurrentWorkEffortStatus.WorkEffortObjectState);
        }