public IntegrationAPITest(ITestOutputHelper testOutputHelper) { builder = new WebHostBuilder().UseEnvironment("Testing").UseStartup <Startup>(); server = new TestServer(builder); client = server.CreateClient(); output = testOutputHelper; dbContext = server.Host.Services.GetService(typeof(notepriveeContext)) as notepriveeContext; NoteKey = Guid.NewGuid().ToString().Replace("-", string.Empty).Substring(0, 30); NoteContent = "note pour test intégration"; Note nNotes = new Note { Contenu = SimpleAES.AES256.Encrypt(NoteContent, NoteKey) }; dbContext.Notes.Add(nNotes); dbContext.SaveChanges(); NoteId = nNotes.Id; }
public AdminController(notepriveeContext context) { _context = context; }
public NotesController(notepriveeContext context) { _context = context; }