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

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

            construction.Name = "NewUpdate";

            // Act
            repo.Update(construction);

            // Assert
            Assert.Equal(construction.Name, repo.GetById(id).Name);

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