Revize 782b6d38
Přidáno uživatelem Vojtěch Bartička před asi 2 roky(ů)
Backend/BackendTesting/UserManagementTesting.cs | ||
---|---|---|
1 |
using System; |
|
1 |
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|
2 |
using Models.Enums; |
|
3 |
using Core.Entities; |
|
4 |
using Serilog; |
|
5 |
|
|
6 |
using System; |
|
2 | 7 |
using System.Collections.Generic; |
3 | 8 |
using System.Linq; |
4 | 9 |
using System.Text; |
5 | 10 |
using System.Threading.Tasks; |
11 |
using Microsoft.EntityFrameworkCore; |
|
12 |
using AutoMapper; |
|
13 |
using Core.MapperProfiles; |
|
14 |
using Core.Contexts; |
|
15 |
using Microsoft.Extensions.Configuration; |
|
6 | 16 |
|
7 |
namespace BackendTesting
|
|
17 |
namespace Core.Services
|
|
8 | 18 |
{ |
9 |
internal class UserManagementTesting
|
|
19 |
public class UserContext : DatabaseContext
|
|
10 | 20 |
{ |
21 |
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 |
|
|
11 | 38 |
} |
12 | 39 |
} |
Také k dispozici: Unified diff
Fixed comments from code review, fixed DB access