public static IEnumerable <Flow> GetFlows() { var flowOdataProvider = new Mock <IFlowOdataProvider>().Object; var repository = new FlowReadRepository(new DataContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)), flowOdataProvider); var result = repository.ListAsync(null, null, null).Result; return(result); }
public static Flow CreateFlow(Guid id, string name) { // prepare var flowOdataProvider = new Mock <IFlowOdataProvider>().Object; var writeRepository = new FlowWriteRepository(new DataContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString))); var readRepository = new FlowReadRepository(new DataContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)), flowOdataProvider); // create var flow = new Flow(id, name); writeRepository.CreateAsync(flow).GetAwaiter().GetResult(); // result var result = readRepository.GetAsync(id).Result; return(result); }