Beispiel #1
0
        public TestBase()
        {
            Context = TicTacToeDbContextFactory.Create();
            var configurationProvider = new MapperConfiguration(x =>
            {
                x.AddProfile <MappingProfile>();
            });

            Mapper = configurationProvider.CreateMapper();

            var dateTimeMock = new Mock <IDateTime>();

            dateTimeMock.Setup(x => x.Now)
            .Returns(new DateTime(2020, 1, 1));
            DateTime = dateTimeMock.Object;

            var currentUserServiceMock = new Mock <ICurrentUserService>();

            currentUserServiceMock.Setup(x => x.UserId)
            .Returns("currentUserId");
            CurrentUserService = currentUserServiceMock.Object;
        }
Beispiel #2
0
 public void Dispose()
 {
     TicTacToeDbContextFactory.Destroy(Context);
 }