Revize 782b6d38
Přidáno uživatelem Vojtěch Bartička před asi 2 roky(ů)
Backend/BackendTesting/Utils.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; |
|
6 | 14 |
|
7 |
namespace BackendTesting
|
|
15 |
namespace Core.Services
|
|
8 | 16 |
{ |
9 |
internal class Utils |
|
17 |
public class Utils |
|
18 |
{ |
|
19 |
} |
|
20 |
|
|
21 |
public static class TestingMapper |
|
22 |
{ |
|
23 |
public static IMapper GetMapper() |
|
24 |
{ |
|
25 |
var mapperConfig = new MapperConfiguration(cfg => |
|
26 |
{ |
|
27 |
cfg.AddProfile<DocumentProfileEF>(); |
|
28 |
cfg.AddProfile<UserProfileEF>(); |
|
29 |
cfg.AddProfile<TagProfileEF>(); |
|
30 |
}); |
|
31 |
|
|
32 |
IMapper mapper = mapperConfig.CreateMapper(); |
|
33 |
return mapper; |
|
34 |
} |
|
35 |
} |
|
36 |
public static class TestingLogger |
|
10 | 37 |
{ |
38 |
public static ILogger GetLogger() |
|
39 |
{ |
|
40 |
return new LoggerConfiguration().WriteTo.Console().CreateLogger(); /* logger */ |
|
41 |
} |
|
11 | 42 |
} |
12 | 43 |
} |
Také k dispozici: Unified diff
Fixed comments from code review, fixed DB access