public BaseHandlerIntegrationTest()
        {
            var _applicationConfiguration = new ApplicationConfiguration();
            var configurationRoot         = TestHelper.GetConfigurationRoot(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            configurationRoot.Bind(_applicationConfiguration);

            var consoleWriter    = new ConsoleWriter(SerilogFixture.UsefullLogger <ConsoleWriter>());
            var authTokenFactory = new OAuthTokenFactory(SerilogFixture.UsefullLogger <OAuthTokenFactory>(), _applicationConfiguration);
            var clientFactory    = new ClientProxyFactory(SerilogFixture.UsefullLogger <ClientProxyFactory>(), authTokenFactory, _applicationConfiguration);
            //var fileHandler = new FileHandlerMock() {ReadFile = FileHandlerMock.WithReadFileAsNoOp(), WriteFile = FileHandlerMock.WithWriteFileAsNoOp()}.Build();
            var fileHandler = new FileHandler(SerilogFixture.UsefullLogger <FileHandler>());

            SchemaClient = clientFactory.GetClientProxy <ISquidexAppSchemaClient>("aut-developer");
            SchemaImportSystemUnderTest = new SchemaImportHandler(SerilogFixture.UsefullLogger <SchemaImportHandler>(), clientFactory, consoleWriter, null);
            SchemaExportSystemUnderTest = new SchemaExportHandler(SerilogFixture.UsefullLogger <SchemaExportHandler>(), clientFactory, consoleWriter, null);
            SchemaDeleteSystemUnderTest = new SchemaDeleteHandler(SerilogFixture.UsefullLogger <SchemaDeleteHandler>(), clientFactory, consoleWriter, null);
            SchemaListSystemUnderTest   = new SchemaListHandler(SerilogFixture.UsefullLogger <SchemaListHandler>(), clientFactory, consoleWriter, null);
            //var schemaTagHandler = new SchemaTagHandler(SerilogFixture.UsefullLogger<ContentDeleteSystemUnderTest>(), clientFactory, null);

            ContentClient = clientFactory.GetClientProxy <ISquidexContentClient>("aut-developer");
            ContentImportSystemUnderTest = new ContentImportHandler(SerilogFixture.UsefullLogger <ContentImportHandler>(), clientFactory, consoleWriter, null);
            ContentExportSystemUnderTest = new ContentExportHandler(SerilogFixture.UsefullLogger <ContentExportHandler>(), clientFactory, consoleWriter, null);
            ContentDeleteSystemUnderTest = new ContentDeleteHandler(SerilogFixture.UsefullLogger <ContentDeleteHandler>(), clientFactory, consoleWriter, null);
            ContentPostSystemUnderTest   = new ContentPostHandler(SerilogFixture.UsefullLogger <ContentImportHandler>(), clientFactory, consoleWriter, null);

            AttachmentClient = clientFactory.GetClientProxy <ISquidexAttachmentClient>("aut-developer");
            AttachmentImportSystemUnderTest   = new AssetImportHandler(SerilogFixture.UsefullLogger <AssetImportHandler>(), clientFactory, consoleWriter, null);
            AttachmentExportSystemUnderTest   = new AssetExportHandler(SerilogFixture.UsefullLogger <AssetExportHandler>(), clientFactory, consoleWriter, null);
            AttachmentDeleteSystemUnderTest   = new AssetDeleteHandler(SerilogFixture.UsefullLogger <AssetDeleteHandler>(), clientFactory, consoleWriter, null);
            AttachmentListSystemUnderTest     = new AssetListHandler(SerilogFixture.UsefullLogger <AssetListHandler>(), clientFactory, consoleWriter, null);
            AttachmentTagSystemUnderTest      = new AssetTagHandler(SerilogFixture.UsefullLogger <AssetTagHandler>(), clientFactory, consoleWriter, null);
            AssetUpdateContentSystemUnderTest = new AssetUpdateContentHandler(SerilogFixture.UsefullLogger <AssetUpdateContentHandler>(), clientFactory, consoleWriter, null);
        }
Ejemplo n.º 2
0
 public static async Task <Unit> ExportContent(ContentExportHandler systemUnderTest, string application, string schema, string path, string all = null, string top = null, string skip = null, string orderBy = null, string queryBy = null, string searchBy = null, string filterBy = null, string aliasCredentials = "aut-developer")
 {
     return(await ExportContent(systemUnderTest, new ContentExportRequest()
     {
         AliasCredentials = aliasCredentials,
         Application = application,
         Schema = schema,
         Path = path,
         All = all,
         Top = top,
         Skip = skip,
         OrderBy = orderBy,
         QueryBy = queryBy,
         SearchBy = searchBy,
         FilterBy = filterBy
     }));
 }
Ejemplo n.º 3
0
 public static async Task <Unit> ExportContent(ContentExportHandler systemUnderTest, ContentExportRequest request)
 {
     return(await systemUnderTest.Handle(request, CancellationToken.None));
 }