예제 #1
0
        public void TransformToChangeOrderTest()
        {
            ConstructionChangeDirective ccd = ConstructionChangeDirectiveService.GetConstructionChangeDirective(new Guid("1a2bfe3b-7577-456d-8484-4f34f67ce42c"));
            ChangeOrder co = ccd.TransformToChangeOrder();

            Assert.AreEqual(6, co.Number);
        }
        public void SaveExistingConstructionChangeDirective()
        {
            ConstructionChangeDirective ccd = this.repository.FindBy("1a2bfe3b-7577-456d-8484-4f34f67ce42c");

            this.testContextInstance.WriteLine("Copy To List Count:  {0}", ccd.CopyToList.Count);
            DateTime signatureDate = DateTime.Now.Date;

            ccd.ArchitectSignatureDate = signatureDate;
            this.repository[ccd.Key]   = ccd;
            this.unitOfWork.Commit();

            // Verify that the CCD was updated
            ConstructionChangeDirective newCcd = this.repository.FindBy(ccd.Key);

            Assert.AreEqual(signatureDate, newCcd.ArchitectSignatureDate.Value);
        }
        public void SaveNewConstructionChangeDirective()
        {
            Project project = ProjectService.GetAllProjects()[0];
            ConstructionChangeDirective ccd = new ConstructionChangeDirective(project.Key, 5);

            ccd.AmountChanged        = 150;
            ccd.ChangeType           = PriceChangeType.ContractSum;
            ccd.PriceChangeDirection = ChangeDirection.Increased;
            ccd.To                   = project.Contacts[0];
            ccd.From                 = EmployeeService.GetEmployees()[0];
            ccd.Contractor           = CompanyService.GetAllCompanies()[0];
            ccd.Description          = "This is a test.";
            ccd.TimeChanged          = 2;
            ccd.TimeChangeDirection  = ChangeDirection.Increased;
            this.repository[ccd.Key] = ccd;
            this.unitOfWork.Commit();

            // Verify that the CCD was added
            ConstructionChangeDirective newCcd = this.repository.FindBy(ccd.Key);

            Assert.AreEqual(5, newCcd.Number);
        }
        public void FindConstructionChangeDirectiveByKey()
        {
            ConstructionChangeDirective ccd = this.repository.FindBy("1a2bfe3b-7577-456d-8484-4f34f67ce42c");

            Assert.AreEqual(1, ccd.Number);
        }