Beispiel #1
0
        public void MapFromDomainEntity_NullContent_ReturnNull()
        {
            //Act
            var response = WorkPackagesLevel1DTO.MapFromDatabaseEntity(null);

            //Assert
            Assert.IsNull(response);
        }
        public static WorkPackagesLevel1 MapFromDomainEntity(WorkPackagesLevel1DTO workPackagesLevel1)
        {
            if (workPackagesLevel1 == null)
            {
                return(null);
            }

            return(new WorkPackagesLevel1()
            {
                Id = workPackagesLevel1.Id,
                Value = workPackagesLevel1.Value,
                Position = workPackagesLevel1.Position
            });
        }
        public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity()
        {
            //Arrange
            var workPackagesLevel1 = new WorkPackagesLevel1DTO()
            {
                Id       = Guid.NewGuid(),
                Value    = "Design Consultants",
                Position = 0
            };
            var response = WorkPackagesLevel1.MapFromDomainEntity(workPackagesLevel1);

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