Example #1
0
        public void Create(int newId)
        {
            var newItem = new Facility
            {
                Id   = newId,
                Name = $"Facility {newId}"
            };

            var repository = new FacilityRepository(_dbContext, _cache.Object, _logger.Object);
            var returnId   = repository.Create(newItem);

            var item = _dbContext.Facilities.Find(returnId);

            Assert.Equal(newId, returnId);
            Assert.NotNull(item);
            Assert.Equal(newItem.Name, item.Name);
        }