コード例 #1
0
        public void MapFromDomainEntity_NullContent_ReturnNull()
        {
            //Act
            var response = ReportingMilestones.MapFromDomainEntity(null);

            //Assert
            Assert.IsNull(response);
        }
コード例 #2
0
        public static ReportingMilestonesDTO MapFromDatabaseEntity(ReportingMilestones reportingMilestones)
        {
            if (reportingMilestones == null)
            {
                return(null);
            }

            return(new ReportingMilestonesDTO()
            {
                Id = reportingMilestones.Id,
                Value = reportingMilestones.Value,
                Position = reportingMilestones.Position
            });
        }
コード例 #3
0
        public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity()
        {
            //Arrange
            var reportingMilestones = new ReportingMilestonesDTO()
            {
                Id       = Guid.NewGuid(),
                Value    = "Receive Business Approval",
                Position = 0
            };
            var response = ReportingMilestones.MapFromDomainEntity(reportingMilestones);

            Assert.IsNotNull(response);
            Assert.AreEqual(reportingMilestones.Id, response.Id);
            Assert.AreEqual(reportingMilestones.Value, response.Value);
            Assert.AreEqual(reportingMilestones.Position, response.Position);
        }
コード例 #4
0
        private static void SeedReportingMilestones(CapRedV2Context context)
        {
            if (context.ReportingMilestones.Any())
            {
                return;
            }
            string[] reportingMilestones =
            {
                "Receive Business Approval",                    "Lease Execution", "Design Development Complete",
                "Construction Document complete/issue for Bid", "Start on Site",   "Commence Move - In"
            };

            for (int i = 0; i < reportingMilestones.Length; i++)
            {
                var reportingMilestone = new ReportingMilestones {
                    Id = Guid.NewGuid(), Position = i, Value = reportingMilestones[i]
                };
                context.ReportingMilestones.Add(reportingMilestone);
            }
        }