public UpdateQuestionCommandTest()
        {
            var cache = new Mock <IDistributedCache>();

            _context = InitAndGetDbContext(out _adminUserId, out _questionId, out _tenantId);
            _updateQuestionCommandHandler = new UpdateQuestionCommandHandler(_context, new CacheManager(cache.Object));
        }
 public UpdateQuestionCommandHandlerTests()
 {
     _autoMocker = new AutoMocker();
     _autoMocker.Use <IMapper>(new MapperConfiguration(x => x.AddMaps(typeof(QuizProfile).Assembly)).CreateMapper());
     _questionCommandHandler = _autoMocker.CreateInstance <UpdateQuestionCommandHandler>();
     _questionRepositoryMock = _autoMocker.GetMock <IRepository <Question> >();
     _quizRepositoryMock     = _autoMocker.GetMock <IRepository <Quiz> >();
 }
Exemple #3
0
        private static UpdateQuestionCommandHandler UpdateQuestionCommandHandler()
        {
            var contextMock = new Mock <AskDbContext>();

            var handler = new UpdateQuestionCommandHandler(contextMock.Object);

            return(handler);
        }
 public UpdateQuestionCommandTests(DatabaseContextFixture fixture)
 {
     _context = fixture.Context;
     _sut     = new UpdateQuestionCommandHandler(_context);
 }