public void GetPropertiesSuccess()
        {
            //Arrange
            var propertyRepository = new PropertyRepository(_container);
            var dbContext          = _serviceProvider.GetRequiredService <DeviserDbContext>();
            var properties         = TestDataRepository.GetProperties();

            foreach (var item in properties)
            {
                propertyRepository.CreateProperty(item);
            }

            //Act
            var result     = propertyRepository.GetProperties();
            var resultItem = result.First();

            //Assert
            Assert.NotNull(result);
            Assert.True(result.Count > 0);
            Assert.NotNull(resultItem);
            Assert.NotEqual(resultItem.Id, Guid.Empty);
            Assert.True(resultItem.CreatedDate > DateTime.MinValue);
            Assert.True(resultItem.LastModifiedDate > DateTime.MinValue);

            //Clean
            dbContext.Property.RemoveRange(dbContext.Property);
        }
        public void UpdatePropertySuccess()
        {
            //Arrange
            var propertyRepository = new PropertyRepository(_container);
            var dbContext          = _serviceProvider.GetRequiredService <DeviserDbContext>();
            var properties         = TestDataRepository.GetProperties();

            foreach (var item in properties)
            {
                propertyRepository.CreateProperty(item);
            }
            var propertyToUpdate = propertyRepository.GetProperties().First();

            propertyToUpdate.Value = "Updated Value";

            //Act
            var result = propertyRepository.UpdateProperty(propertyToUpdate);

            //Assert
            Assert.NotNull(result);
            Assert.NotEqual(result.Id, Guid.Empty);
            Assert.True(!string.IsNullOrEmpty(result.Name));
            Assert.True(!string.IsNullOrEmpty(result.Label));
            Assert.True(propertyToUpdate.Value == result.Value);
            Assert.True(result.CreatedDate > DateTime.MinValue);
            Assert.True(result.LastModifiedDate > DateTime.MinValue);

            //Clean
            dbContext.Property.RemoveRange(dbContext.Property);
        }
        public void CreatePropertyFail()
        {
            //Arrange
            var      propertyRepository = new PropertyRepository(_container);
            var      dbContext          = _serviceProvider.GetRequiredService <DeviserDbContext>();
            var      properties         = TestDataRepository.GetProperties();
            Property property           = null;


            //Act
            var result = propertyRepository.CreateProperty(property);

            //Assert
            Assert.Null(result);

            //Clean
            dbContext.Property.RemoveRange(dbContext.Property);
        }
        public void CreateProperty(PropertyRequest property)
        {
            var prop = _mapper.Map <PropertyEntitiy>(property);

            PropertyRepository.CreateProperty(prop);
        }