Ejemplo n.º 1
0
        public async Task RemoveSetAsync_WhenCalled_RemoveSetFromDbAsync()
        {
            var set = _setUpContext.Sets.Find(1);

            await _setService.RemoveSetAsync(set);

            var removedSet = _context.Sets.FirstOrDefault(q => q.Id == 1);

            Assert.That(removedSet, Is.Null);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            this.Set = await _setService.GetSetByIdAsync((int)id);

            if (Set != null)
            {
                await _setService.RemoveSetAsync(this.Set);
            }

            return(RedirectToPage("./Index"));
        }