예제 #1
0
        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;
        }
예제 #2
0
 public AdminController(notepriveeContext context)
 {
     _context = context;
 }
예제 #3
0
 public NotesController(notepriveeContext context)
 {
     _context = context;
 }