public UpdatePackScheduleParameters(PackSchedule packSchedule)
 {
     PackScheduleKey         = new PackScheduleKey(packSchedule);
     BatchTargetWeight       = packSchedule.DefaultBatchTargetParameters.BatchTargetWeight;
     BatchTargetAsta         = packSchedule.DefaultBatchTargetParameters.BatchTargetAsta;
     BatchTargetScan         = packSchedule.DefaultBatchTargetParameters.BatchTargetScan;
     BatchTargetScoville     = packSchedule.DefaultBatchTargetParameters.BatchTargetScoville;
     WorkTypeKey             = new WorkTypeKey(packSchedule);
     ChileProductKey         = new WorkTypeKey(packSchedule);
     PackagingProductKey     = new WorkTypeKey(packSchedule);
     ScheduledProductionDate = packSchedule.ScheduledProductionDate;
     ProductionDeadline      = packSchedule.ProductionDeadline;
     ProductionLineKey       = new LocationKey(packSchedule);
     SummaryOfWork           = packSchedule.SummaryOfWork;
     CustomerKey             = packSchedule.CustomerId == null ? null : new CustomerKey(packSchedule);
     OrderNumber             = packSchedule.OrderNumber;
 }
示例#2
0
            public void Returns_all_WorkTypes_in_database()
            {
                //Arrange
                var expectedWorkTypeKey0 = new WorkTypeKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <WorkType>());
                var expectedWorkTypeKey1 = new WorkTypeKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <WorkType>());
                var expectedWorkTypeKey2 = new WorkTypeKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <WorkType>());

                //Act
                var result = Service.GetWorkTypes();

                //Assert
                result.AssertSuccess();
                var workTypes = result.ResultingObject.ToList();

                Assert.IsNotNull(workTypes.SingleOrDefault(w => w.WorkTypeKey == expectedWorkTypeKey0.KeyValue));
                Assert.IsNotNull(workTypes.SingleOrDefault(w => w.WorkTypeKey == expectedWorkTypeKey1.KeyValue));
                Assert.IsNotNull(workTypes.SingleOrDefault(w => w.WorkTypeKey == expectedWorkTypeKey2.KeyValue));
            }