public void MapFromDomainEntity_NullContent_ReturnNull()
        {
            //Act
            var response = RolloverCategoryDTO.MapFromDatabaseEntity(null);

            //Assert
            Assert.IsNull(response);
        }
Ejemplo n.º 2
0
        public static RolloverCategory MapFromDomainEntity(RolloverCategoryDTO rolloverCategory)
        {
            if (rolloverCategory == null)
            {
                return(null);
            }

            return(new RolloverCategory()
            {
                Id = rolloverCategory.Id,
                Value = rolloverCategory.Value,
                Position = rolloverCategory.Position
            });
        }
        public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity()
        {
            //Arrange
            var rolloverCategory = new RolloverCategory()
            {
                Id       = Guid.NewGuid(),
                Value    = "Pending Submission",
                Position = 0
            };
            var response = RolloverCategoryDTO.MapFromDatabaseEntity(rolloverCategory);

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