Esempio n. 1
0
        public async Task TestAdminDeleteIdeaInvalidId()
        {
            ACMDbContext    context         = ACMDbContextInMemoryFactory.InitializeContext();
            HomeownerSevice homeownerSevice = new HomeownerSevice(context);
            Idea            idea            = new Idea {
                Id = "1"
            };
            await context.AddAsync(idea);

            await context.SaveChangesAsync();

            await Assert.ThrowsAsync <ACMException>(() => homeownerSevice.AdminDeleteIdea("2"));
        }
Esempio n. 2
0
        public async Task TestAdminDeleteIdeaGoodData()
        {
            ACMDbContext    context         = ACMDbContextInMemoryFactory.InitializeContext();
            HomeownerSevice homeownerSevice = new HomeownerSevice(context);
            Idea            idea            = new Idea {
                Id = "1"
            };
            await context.AddAsync(idea);

            await context.SaveChangesAsync();

            bool output = await homeownerSevice.AdminDeleteIdea("1");

            Assert.True(output);
            Assert.Empty(context.Ideas.ToList());
        }