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); } }
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); }
private PageRepository CreateRepository() { IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(null, _outputHelper); return(new PageRepository(documentStore)); }
public PageRepository CreateRepository() { IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(typeof(PageRepositoryTests), _outputHelper); return(new PageRepository(documentStore)); }
public UserRefreshTokenRepository CreateRepository() { IDocumentStore documentStore = DocumentStoreManager.GetMartenDocumentStore(typeof(UserRefreshTokenRepositoryTests), _outputHelper); return(new UserRefreshTokenRepository(documentStore)); }