Exemplo n.º 1
0
        public void Delete_ShouldDeleteConstruction()
        {
            // Arrange
            var context = GetContext();
            var repo    = new SqlConstructionRepo(context);

            int id           = _rnd.Next(1, _constructions.Count());
            var construction = _constructions.FirstOrDefault(v => v.Id == id);

            // Act
            repo.Delete(construction);

            // Assert
            Assert.Null(repo.GetById(id));

            context.Database.EnsureDeleted();
            context.Dispose();
        }