public CategoriesControllerDeleteTests(Request <Startup> request, DbContextFactory contextFactory, ITestOutputHelper output) { this.request = request; this.nieuweStroomPocDbContext = contextFactory.nieuweStroomPocDbContext; this.output = output; var category = new Category { Description = "Description" }; nieuweStroomPocDbContext.Add(category); nieuweStroomPocDbContext.SaveChanges(); Id = category.Id; nieuweStroomPocDbContext = contextFactory.GetRefreshContext(); var user = new User() { Email = "", Name = "", Lastname = "", Id = 1 }; Token = request.Jwt.GenerateToken(user); }
public RolesControllerDeleteTests(ITestOutputHelper output, Request <Startup> request, DbContextFactory contextFactory) { this.output = output; this.request = request; this.nieuweStroomPocDbContext = contextFactory.nieuweStroomPocDbContext; var role = new Role { Description = "Description" }; nieuweStroomPocDbContext.Roles.Add(role); nieuweStroomPocDbContext.SaveChanges(); Id = role.Id; nieuweStroomPocDbContext = contextFactory.GetRefreshContext(); var user = new User() { Email = "", Name = "", Lastname = "", Id = 1 }; Token = request.Jwt.GenerateToken(user); }
public UsersControllerTests(ITestOutputHelper output, Request <Startup> request, DbContextFactory contextFactory) { this.output = output; this.request = request; this.nieuweStroomPocDbContext = contextFactory.nieuweStroomPocDbContext; var role = new Role { Description = "Description" }; nieuweStroomPocDbContext.Roles.Add(role); nieuweStroomPocDbContext.SaveChanges(); nieuweStroomPocDbContext = contextFactory.GetRefreshContext(); userResource = new SaveUserResource { Email = "*****@*****.**", Name = "12345", Lastname = "1233456", Password = "******", }; userResource.Roles.Add(role.Id); }
public void Dispose() { nieuweStroomPocDbContext.Users.RemoveRange(nieuweStroomPocDbContext.Users); nieuweStroomPocDbContext.Roles.RemoveRange(nieuweStroomPocDbContext.Roles); nieuweStroomPocDbContext.SaveChanges(); }
public void Dispose() { nieuweStroomPocDbContext.Categories.RemoveRange(nieuweStroomPocDbContext.Categories); nieuweStroomPocDbContext.SaveChanges(); }