public UserRefreshTokenRepositoryTests(ITestOutputHelper outputHelper)
        {
            _outputHelper = outputHelper;
            IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(typeof(UserRefreshTokenRepositoryTests), outputHelper);

            try
            {
                new UserRepository(documentStore).Wipe();
            }
            catch (Exception e)
            {
                outputHelper.WriteLine(GetType().Name + " caught: " + e.Message);
            }
        }
Exemplo n.º 2
0
        public PageRepositoryTests(ITestOutputHelper outputHelperHelper)
        {
            _outputHelper = outputHelperHelper;
            _fixture      = new Fixture();
            IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(typeof(PageRepositoryTests), outputHelperHelper);

            try
            {
                new PageRepository(documentStore).Wipe();
            }
            catch (Exception e)
            {
                outputHelperHelper.WriteLine(GetType().Name + " caught: " + e.ToString());
            }
        }
        private List <PageVersion> CreateTenPages(PageVersionRepository repository)
        {
            IDocumentStore documentStore  = DocumentStoreManager.GetMartenDocumentStore(typeof(PageVersionRepository), _outputHelper);
            var            pageRepository = new PageRepository(documentStore);

            List <Page> pages = _fixture.CreateMany <Page>(10).ToList();

            var pageVersions = new List <PageVersion>();

            foreach (Page page in pages)
            {
                string   text     = _fixture.Create <string>();
                string   author   = _fixture.Create <string>();
                DateTime dateTime = DateTime.Today;

                Page        newPage     = pageRepository.AddNewPageAsync(page).GetAwaiter().GetResult();
                PageVersion pageVersion = repository.AddNewVersionAsync(newPage.Id, text, author, dateTime).GetAwaiter().GetResult();
                pageVersions.Add(pageVersion);
            }

            return(pageVersions);
        }
Exemplo n.º 4
0
        private PageRepository CreateRepository()
        {
            IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(null, _outputHelper);

            return(new PageRepository(documentStore));
        }
Exemplo n.º 5
0
        public PageRepository CreateRepository()
        {
            IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(typeof(PageRepositoryTests), _outputHelper);

            return(new PageRepository(documentStore));
        }
Exemplo n.º 6
0
        public UserRefreshTokenRepository CreateRepository()
        {
            IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(typeof(UserRefreshTokenRepositoryTests), _outputHelper);

            return(new UserRefreshTokenRepository(documentStore));
        }