Пример #1
0
 public void PreviousTimeChangedTotalTest()
 {
     object projectKey = new Guid("5704f6b9-6ffa-444c-9583-35cc340fce2a");
     int number = 5;
     ChangeOrder target = new ChangeOrder(projectKey, number);
     int actual = target.PreviousTimeChangedTotal;
     Assert.AreEqual(4, actual);
 }
Пример #2
0
 public static int GetPreviousTimeChangedTotalFrom(ChangeOrder co)
 {
     return
         (ChangeOrderService.repository.GetPreviousTimeChangedTotalFrom(co));
 }
Пример #3
0
 public static decimal GetPreviousAuthorizedAmountFrom(ChangeOrder co)
 {
     return
         (ChangeOrderService.repository.GetPreviousAuthorizedAmountFrom(co));
 }
Пример #4
0
 public static void SaveChangeOrder(ChangeOrder co)
 {
     ChangeOrderService.repository[co.Key] = co;
     ChangeOrderService.unitOfWork.Commit();
 }
Пример #5
0
 public static ChangeOrder ToChangeOrder(ChangeOrderContract contract)
 {
     ChangeOrder co = null;
     if (contract != null)
     {
         co = new ChangeOrder(contract.Key, contract.ProjectKey, contract.Number);
         co.AgencyApprovedDate = contract.AgencyApprovedDate;
         co.AmountChanged = contract.AmountChanged;
         co.ArchitectSignatureDate = contract.ArchitectSignatureDate;
         co.ChangeType = Converter.ToPriceChangeType(contract.ChangeType);
         co.PriceChangeDirection = Converter.ToChangeDirection(contract.ChangeTypeDirection);
         co.Contractor = Converter.ToCompany(contract.Contractor);
         co.ContractorSignatureDate = contract.ContractorSignatureDate;
         co.DateToField = contract.DateToField;
         co.Description = contract.Description;
         co.EffectiveDate = contract.EffectiveDate;
         co.OwnerSignatureDate = contract.OwnerSignatureDate;
         foreach (RoutingItemContract item in contract.RoutingItems)
         {
             co.RoutingItems.Add(Converter.ToRoutingItem(item));
         }
         co.Status = Converter.ToItemStatus(contract.Status);
         co.TimeChanged = contract.TimeChanged;
         co.TimeChangeDirection = Converter.ToChangeDirection(contract.TimeChangeDirection);
     }
     return co;
 }
Пример #6
0
 public static ChangeOrderContract ToChangeOrderContract(ChangeOrder co)
 {
     ChangeOrderContract contract = null;
     if (co != null)
     {
         contract = new ChangeOrderContract();
         contract.AgencyApprovedDate = co.AgencyApprovedDate;
         contract.AmountChanged = co.AmountChanged;
         contract.ArchitectSignatureDate = co.ArchitectSignatureDate;
         contract.ChangeType = Converter.ToPriceChangeTypeContract(co.ChangeType);
         contract.ChangeTypeDirection = Converter.ToChangeDirectionContract(co.PriceChangeDirection);
         contract.Contractor = Converter.ToCompanyContract(co.Contractor);
         contract.ContractorSignatureDate = co.ContractorSignatureDate;
         contract.DateOfSubstantialCompletion = co.DateOfSubstantialCompletion;
         contract.DateToField = co.DateToField;
         contract.Description = co.Description;
         contract.EffectiveDate = co.EffectiveDate;
         contract.Key = co.Key;
         contract.NewConstructionCost = co.NewConstructionCost;
         contract.Number = co.Number;
         contract.OriginalConstructionCost = co.OriginalConstructionCost;
         contract.OwnerSignatureDate = co.OwnerSignatureDate;
         contract.PreviousAuthorizedChangeOrderAmount = co.PreviousAuthorizedAmount;
         contract.PreviousTimeChangedTotal = co.PreviousTimeChangedTotal;
         contract.ProjectKey = co.ProjectKey;
         foreach (RoutingItem item in co.RoutingItems)
         {
             contract.RoutingItems.Add(Converter.ToRoutingItemContract(item));
         }
         contract.Status = Converter.ToItemStatusContract(co.Status);
         contract.TimeChanged = co.TimeChanged;
         contract.TimeChangeDirection = Converter.ToChangeDirectionContract(co.TimeChangeDirection);
     }
     return contract;
 }
Пример #7
0
 public void OriginalConstructionCostTest()
 {
     object projectKey = new Guid("5704f6b9-6ffa-444c-9583-35cc340fce2a");
     int number = 5;
     ChangeOrder target = new ChangeOrder(projectKey, number);
     decimal actual = target.OriginalConstructionCost;
     Assert.AreEqual(100000M, actual);
 }
Пример #8
0
 public void PreviousAuthorizedChangeOrderAmountTest()
 {
     object projectKey = new Guid("5704f6b9-6ffa-444c-9583-35cc340fce2a");
     int number = 5;
     ChangeOrder target = new ChangeOrder(projectKey, number);
     decimal actual = target.PreviousAuthorizedAmount;
     Assert.AreEqual(4000M, actual);
 }
Пример #9
0
 public void ChangeOrderConstructorTestFull()
 {
     object key = Guid.NewGuid();
     object projectKey = new Guid("5704f6b9-6ffa-444c-9583-35cc340fce2a");
     int number = 5;
     ChangeOrder target = new ChangeOrder(key, projectKey, number);
     // There should be 3 broken rules
     Assert.AreEqual(3, target.GetBrokenRules().Count);
 }
Пример #10
0
 public static int GetPreviousTimeChangedTotalFrom(ChangeOrder co)
 {
     return 
         ChangeOrderService.repository.GetPreviousTimeChangedTotalFrom(co);
 }
Пример #11
0
 public static decimal GetPreviousAuthorizedAmountFrom(ChangeOrder co)
 {
     return 
         ChangeOrderService.repository.GetPreviousAuthorizedAmountFrom(co);
 }
Пример #12
0
 public static void SaveChangeOrder(ChangeOrder co)
 {
     ChangeOrderService.repository[co.Key] = co;
     ChangeOrderService.unitOfWork.Commit();
 }
Пример #13
0
 public void SaveNewChangeOrder()
 {
     ChangeOrder co = new ChangeOrder(new Guid("5704f6b9-6ffa-444c-9583-35cc340fce2a"), 5);
     co.AmountChanged = 150;
     co.ChangeType = PriceChangeType.ContractSum;
     co.PriceChangeDirection = ChangeDirection.Increased;
     co.Contractor = CompanyService.GetCompany("8b6a05be-6106-45fb-b6cc-b03cfa5ab74b");
     co.Description = "This is a test.";
     co.TimeChanged = 2;
     co.TimeChangeDirection = ChangeDirection.Increased;
     co.Status = new ItemStatus(8, "Pend. Arch.");
     Exception error = null;
     try
     {
         this.repository[co.Key] = co;
         this.unitOfWork.Commit();
     }
     catch (Exception e)
     {
         error = e;
         this.testContextInstance.WriteLine(e.ToString());
     }
     Assert.IsNull(error);
 }