public void ReadModelRepositoryDeleteMethodShouldThrowExceptionIfNullIsAdded() { var repository = new TestModelRepository(); Action act = () => repository.Delete(null); act.ShouldThrow <ModelRepositoryDeleteException>(); }
public void ReadModelRepositoryDeleteMethodShouldThrowExceptionIfItemWIthEmptyIsAdded() { var repository = new TestModelRepository(); Action act = () => repository.Delete(new Test(Guid.Empty)); act.ShouldThrow <ModelRepositoryDeleteException>(); }
public void ReadModelRepositoryShouldDeleteAnItem() { var guid = Guid.NewGuid(); var item = new Test(guid) { Name = "Testitem" }; var repository = new TestModelRepository(); repository.Add(item); repository.Delete(item); repository.GetById(guid).Should().Be(null); }