private static void SeedCostCodeLevel1(CapRedV2Context context)
        {
            if (context.CostCodeLevel1s.Any())
            {
                return;
            }
            string[] costCodeLevel1s =
            {
                "A10 - Foundations",                       "A20 - Basement Construction",     "B10 - Superstructure",                     "10 - Interior Construction",
                "D10 - Building Services",                 "E10 - Equipment ES",              "E12 - Equipment Tech",                     "E13 - Equipment AV",
                "E14 - Equipment Data Center",             "E20 - Furnishings and Furniture", "F20 - Demolition",                         "G10 - Sitework",
                "Z01 - Contractor Indirect Costs and Fee", "Z10 - Design Consultants",        "Z20 - Project Management and Consultants",
                "Z30 - Approvals",                         "Z40 - Migration",                 "Z50 - Landlord Costs",                     "Z60 - Sales/Use Tax and VAT",
                "Z72 - ARO & Restoration",                 "Z80 - Land Purchase",             "Z90 - Contingencies and Allowances",       "Furnishings",
                "Selective Building Demolition",           "Site Preparation",                "Site Improvements",                        "Site Civil/Mechanical Utilities",
                "Site Electrical Utilities",               "PreConstruction",                 "General Requirements",                     "Design Consultants",
                "Project Management",                      "Statutory Approvals",             "Move costs",
                "Landlord Costs",                          "Tax",                             "Expensed Project Costs",                   "Asset Restoration Requirements", "Day Two",
                "Land & Building Purchase",                "Contingencies & Allowances"
            };

            for (int i = 0; i < costCodeLevel1s.Length; i++)
            {
                var costCodeLevel1 = new CostCodeLevel1 {
                    Id = Guid.NewGuid(), Position = i, Value = costCodeLevel1s[i]
                };
                context.CostCodeLevel1s.Add(costCodeLevel1);
            }
        }
Example #2
0
        public void MapFromDomainEntity_NullContent_ReturnNull()
        {
            //Act
            var response = CostCodeLevel1.MapFromDomainEntity(null);

            //Assert
            Assert.IsNull(response);
        }
        public static CostCodeLevel1DTO MapFromDatabaseEntity(CostCodeLevel1 costCodeLevel1)
        {
            if (costCodeLevel1 == null)
            {
                return(null);
            }

            return(new CostCodeLevel1DTO()
            {
                Id = costCodeLevel1.Id,
                Value = costCodeLevel1.Value,
                Position = costCodeLevel1.Position
            });
        }
        public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity()
        {
            //Arrange
            var costCodeLevel1 = new CostCodeLevel1()
            {
                Id       = Guid.NewGuid(),
                Value    = "A10 - Foundations",
                Position = 0
            };
            var response = CostCodeLevel1DTO.MapFromDatabaseEntity(costCodeLevel1);

            Assert.IsNotNull(response);
            Assert.AreEqual(costCodeLevel1.Id, response.Id);
            Assert.AreEqual(costCodeLevel1.Value, response.Value);
            Assert.AreEqual(costCodeLevel1.Position, response.Position);
        }