Beispiel #1
0
        public async Task Exist_WithInvalidId_ShouldWorkCorrectly(int id)
        {
            var context = WilderExperienceContextInMemoryFactory.InitializeContext();

            var repository = new EfDeletableEntityRepository <Comment>(context);
            var service    = new CommentsService(repository);
            var reuslt     = service.Exists(id);

            Assert.True(reuslt == false);
        }
Beispiel #2
0
        public async Task Exist_ShouldWorkCorrectly()
        {
            var context = WilderExperienceContextInMemoryFactory.InitializeContext();

            await this.SeedData(context);

            int testExperienceId = context.Comments.First().Id;

            var repository = new EfDeletableEntityRepository <Comment>(context);
            var service    = new CommentsService(repository);
            var result     = service.Exists(testExperienceId);

            Assert.True(result);
        }