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

            //Assert
            Assert.IsNull(response);
        }
Exemplo n.º 2
0
        public static BudgetItemType MapFromDomainEntity(BudgetItemTypeDTO budgetItemType)
        {
            if (budgetItemType == null)
            {
                return(null);
            }

            return(new BudgetItemType()
            {
                Id = budgetItemType.Id,
                Value = budgetItemType.Value,
                Position = budgetItemType.Position
            });
        }
Exemplo n.º 3
0
        public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity()
        {
            //Arrange
            var budgetItemType = new BudgetItemType()
            {
                Id       = Guid.NewGuid(),
                Value    = "Original Order",
                Position = 0
            };
            var response = BudgetItemTypeDTO.MapFromDatabaseEntity(budgetItemType);

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