public void MapFromDomainEntity_NullContent_ReturnNull() { //Act var response = CostCodeLevel2DTO.MapFromDatabaseEntity(null); //Assert Assert.IsNull(response); }
public static CostCodeLevel2 MapFromDomainEntity(CostCodeLevel2DTO costCodeLevel2) { if (costCodeLevel2 == null) { return(null); } return(new CostCodeLevel2() { Id = costCodeLevel2.Id, Value = costCodeLevel2.Value, Position = costCodeLevel2.Position }); }
public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity() { //Arrange var costCodeLevel2 = new CostCodeLevel2() { Id = Guid.NewGuid(), Value = "A1030 - Slab Construction", Position = 2 }; var response = CostCodeLevel2DTO.MapFromDatabaseEntity(costCodeLevel2); Assert.IsNotNull(response); Assert.AreEqual(costCodeLevel2.Id, response.Id); Assert.AreEqual(costCodeLevel2.Value, response.Value); Assert.AreEqual(costCodeLevel2.Position, response.Position); }