public void Should_Update_Existing_Layer(int id) { var fakeContext = new FakeContext("UpdateLayer"); fakeContext.FillWith <Layer>(); using (var context = new MainContext(fakeContext.FakeOptions)) { var repository = new LayerRepository(context); var validator = new LayerValidator(); var service = new LayerService(repository, validator); var curretLayer = service.GetById(id); curretLayer.Name = "Testing"; service.Update(curretLayer); Assert.Equal("Testing", service.GetById(id).Name); repository.Dispose(); } }