public void MapFromDomainEntity_NullContent_ReturnNull()
        {
            //Act
            var response = RealEstateOrBau.MapFromDomainEntity(null);

            //Assert
            Assert.IsNull(response);
        }
Exemple #2
0
        public static RealEstateOrBauDTO MapFromDatabaseEntity(RealEstateOrBau realEstateOrBau)
        {
            if (realEstateOrBau == null)
            {
                return(null);
            }

            return(new RealEstateOrBauDTO()
            {
                Id = realEstateOrBau.Id,
                Value = realEstateOrBau.Value,
                Position = realEstateOrBau.Position
            });
        }
        public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity()
        {
            //Arrange
            var realEstateOrBauDTO = new RealEstateOrBauDTO()
            {
                Id       = Guid.NewGuid(),
                Value    = "AMER",
                Position = 0
            };
            var response = RealEstateOrBau.MapFromDomainEntity(realEstateOrBauDTO);

            Assert.IsNotNull(response);
            Assert.AreEqual(realEstateOrBauDTO.Id, response.Id);
            Assert.AreEqual(realEstateOrBauDTO.Value, response.Value);
            Assert.AreEqual(realEstateOrBauDTO.Position, response.Position);
        }
        private static void SeedRealEstateOrBau(CapRedV2Context context)
        {
            if (context.RealEstateOrBaus.Any())
            {
                return;
            }
            string[] realEstateOrBaus = { "BAU", "RE" };

            for (int i = 0; i < realEstateOrBaus.Length; i++)
            {
                var realEstateOrBau = new RealEstateOrBau {
                    Id = Guid.NewGuid(), Position = i, Value = realEstateOrBaus[i]
                };
                context.RealEstateOrBaus.Add(realEstateOrBau);
            }
        }