1
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
2
|
using Models.Enums;
|
3
|
using Core.Entities;
|
4
|
using Serilog;
|
5
|
|
6
|
using System;
|
7
|
using System.Collections.Generic;
|
8
|
using System.Linq;
|
9
|
using System.Text;
|
10
|
using System.Threading.Tasks;
|
11
|
using Microsoft.EntityFrameworkCore;
|
12
|
using AutoMapper;
|
13
|
using Core.MapperProfiles;
|
14
|
|
15
|
namespace Core.Services
|
16
|
{
|
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
|
37
|
{
|
38
|
public static ILogger GetLogger()
|
39
|
{
|
40
|
return new LoggerConfiguration().WriteTo.Console().CreateLogger(); /* logger */
|
41
|
}
|
42
|
}
|
43
|
}
|