public async Task Return_True_IfDeleted() { var options = Utils.GetOptions(nameof(Return_True_IfDeleted)); var categoryService = new Mock <ICategoryService>().Object; var userService = new Mock <IUserService>().Object; var userStore = new Mock <IUserStore <User> >(); var userManager = new Mock <UserManager <User> >(userStore.Object, null, null, null, null, null, null, null, null).Object; var contextAccessor = new Mock <IHttpContextAccessor>().Object; var userPrincipalFactory = new Mock <IUserClaimsPrincipalFactory <User> >().Object; var signManager = new Mock <SignInManager <User> >(userManager, contextAccessor, userPrincipalFactory, null, null, null, null).Object; using (var arrContext = new PhotoContestContext(options)) { await arrContext.Statuses.AddRangeAsync(Utils.SeedStatuses()); await arrContext.Categories.AddRangeAsync(Utils.SeedCategories()); await arrContext.Contests.AddRangeAsync(Utils.SeedContests()); await arrContext.SaveChangesAsync(); } using (var actContext = new PhotoContestContext(options)) { var sut = new ContestService(actContext, contextAccessor, userService, categoryService, userManager, signManager); var result = await sut.DeleteAsync(actContext.Contests.First().Name); Assert.IsTrue(actContext.Contests.First().IsDeleted); } }