Example #1
0
        public void ReadModelRepositoryDeleteMethodShouldThrowExceptionIfNullIsAdded()
        {
            var    repository = new TestModelRepository();
            Action act        = () => repository.Delete(null);

            act.ShouldThrow <ModelRepositoryDeleteException>();
        }
Example #2
0
        public void ReadModelRepositoryDeleteMethodShouldThrowExceptionIfItemWIthEmptyIsAdded()
        {
            var    repository = new TestModelRepository();
            Action act        = () => repository.Delete(new Test(Guid.Empty));

            act.ShouldThrow <ModelRepositoryDeleteException>();
        }
Example #3
0
        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);
        }