public void MapFromDomainEntity_NullContent_ReturnNull() { //Act var response = ReportingMilestones.MapFromDomainEntity(null); //Assert Assert.IsNull(response); }
public static ReportingMilestonesDTO MapFromDatabaseEntity(ReportingMilestones reportingMilestones) { if (reportingMilestones == null) { return(null); } return(new ReportingMilestonesDTO() { Id = reportingMilestones.Id, Value = reportingMilestones.Value, Position = reportingMilestones.Position }); }
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); }
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); } }