1 |
782b6d38
|
Vojtěch Bartička
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
2 |
|
|
using Models.Enums;
|
3 |
|
|
using Core.Entities;
|
4 |
|
|
using Serilog;
|
5 |
|
|
|
6 |
|
|
using System;
|
7 |
773d1205
|
schenkj
|
using System.Collections.Generic;
|
8 |
|
|
using System.Linq;
|
9 |
|
|
using System.Text;
|
10 |
|
|
using System.Threading.Tasks;
|
11 |
782b6d38
|
Vojtěch Bartička
|
using Microsoft.EntityFrameworkCore;
|
12 |
|
|
using AutoMapper;
|
13 |
|
|
using Core.MapperProfiles;
|
14 |
|
|
using Core.Contexts;
|
15 |
|
|
using Microsoft.Extensions.Configuration;
|
16 |
773d1205
|
schenkj
|
|
17 |
782b6d38
|
Vojtěch Bartička
|
namespace Core.Services
|
18 |
773d1205
|
schenkj
|
{
|
19 |
782b6d38
|
Vojtěch Bartička
|
public class UserContext : DatabaseContext
|
20 |
773d1205
|
schenkj
|
{
|
21 |
782b6d38
|
Vojtěch Bartička
|
public UserContext(IConfiguration configuration) : base(configuration) { }
|
22 |
|
|
|
23 |
|
|
//public static ILoggerFactory logger = LoggerFactory.Create(builder => { builder.AddConsole(); });
|
24 |
|
|
public ILogger logger = new LoggerConfiguration().WriteTo.Console().CreateLogger(); /* logger */
|
25 |
|
|
|
26 |
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
27 |
|
|
{
|
28 |
|
|
base.OnConfiguring(optionsBuilder);
|
29 |
|
|
optionsBuilder.UseSqlite("Data source=db.sqlite", b => b.MigrationsAssembly("RestAPI"));
|
30 |
|
|
//optionsBuilder.(logger);
|
31 |
|
|
}
|
32 |
|
|
|
33 |
|
|
}
|
34 |
|
|
[TestClass]
|
35 |
|
|
public class UserManagementTesting //testing of Core/Services/UserService
|
36 |
|
|
{
|
37 |
|
|
|
38 |
773d1205
|
schenkj
|
}
|
39 |
|
|
}
|