public void ReadModelRepositoryUpdateMethodShouldThrowExceptionIfItemWIthEmptyIsAdded() { var repository = new TestModelRepository(); Action act = () => repository.Update(new Test(Guid.Empty)); act.ShouldThrow <ModelRepositoryUpdateException>(); }
public void ReadModelRepositoryUpdateMethodShouldThrowExceptionIfNullIsAdded() { var repository = new TestModelRepository(); Action act = () => repository.Update(null); act.ShouldThrow <ModelRepositoryUpdateException>(); }
public void ReadModelRepositoryShouldUpdateAnItem() { var guid = Guid.NewGuid(); var item = new Test(guid) { Name = "Testitem" }; var itemUpdate = new Test(guid) { Name = "Testitem Update" }; var repository = new TestModelRepository(); repository.Add(item); repository.Update(itemUpdate); repository.GetById(guid).Name.Should().Be("Testitem Update"); }