Ejemplo n.º 1
0
        public void MapFromDomainEntity_NullContent_ReturnNull()
        {
            //Act
            var response = BusinessDriverDTO.MapFromDatabaseEntity(null);

            //Assert
            Assert.IsNull(response);
        }
Ejemplo n.º 2
0
        public static BusinessDriver MapFromDomainEntity(BusinessDriverDTO businessDriver)
        {
            if (businessDriver == null)
            {
                return(null);
            }

            return(new BusinessDriver()
            {
                Id = businessDriver.Id,
                Value = businessDriver.Value,
                Position = businessDriver.Position
            });
        }
Ejemplo n.º 3
0
        public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity()
        {
            //Arrange
            var businessDriver = new BusinessDriverDTO()
            {
                Id       = Guid.NewGuid(),
                Value    = "Run",
                Position = 0
            };
            var response = BusinessDriver.MapFromDomainEntity(businessDriver);

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