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);
            }
        }
示例#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);
        }
示例#4
0
        private PageRepository CreateRepository()
        {
            IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(null, _outputHelper);

            return(new PageRepository(documentStore));
        }
示例#5
0
        public PageRepository CreateRepository()
        {
            IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(typeof(PageRepositoryTests), _outputHelper);

            return(new PageRepository(documentStore));
        }
示例#6
0
        public UserRefreshTokenRepository CreateRepository()
        {
            IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(typeof(UserRefreshTokenRepositoryTests), _outputHelper);

            return(new UserRefreshTokenRepository(documentStore));
        }