コード例 #1
0
        public AddEntityCategoriesFixture(OsdrTestHarness harness)
        {
            var categories = new List <TreeNode>()
            {
                new TreeNode("Category Root", new List <TreeNode>()
                {
                    new TreeNode("My Test Category"),
                    new TreeNode("Projects Two")
                })
            };

            var response = harness.JohnApi.PostData("api/categorytrees/tree", categories).Result;

            var content = response.Content.ReadAsStringAsync().Result;

            TreeId = Guid.Parse(content);

            harness.WaitWhileCategoryTreePersisted(TreeId);

            BlobId = harness.JohnBlobStorageClient.AddResource(harness.JohnId.ToString(), "Chemical-diagram.png", new Dictionary <string, object>()
            {
                { "parentId", harness.JohnId }
            }).Result;

            FileId = harness.WaitWhileFileProcessed(BlobId);

            // add category to entity
            response = harness.JohnApi.PostData($"/api/categoryentities/entities/{FileId}/categories", new List <Guid> {
                TreeId
            }).Result;
            response.EnsureSuccessStatusCode();
            harness.WaitWhileCategoryIndexed(FileId.ToString());
        }
コード例 #2
0
        public DeleteEntityCategoryFixture(OsdrTestHarness harness)
        {
            var categories = new List <TreeNode>()
            {
                new TreeNode("Category Root", new List <TreeNode>()
                {
                    new TreeNode("My Test Category"),
                    new TreeNode("Projects Two")
                })
            };

            var response = harness.JohnApi.PostData("api/categorytrees/tree", categories).Result;

            var content = response.Content.ReadAsStringAsync().Result;

            RootCategoryId = Guid.Parse(content);

            harness.WaitWhileCategoryTreePersisted(RootCategoryId);

            BlobId = harness.JohnBlobStorageClient.AddResource(harness.JohnId.ToString(), "Chemical-diagram.png", new Dictionary <string, object>()
            {
                { "parentId", harness.JohnId }
            }).Result;

            FileId = harness.WaitWhileFileProcessed(BlobId);
        }
コード例 #3
0
 public ReadEventsBackwardAsyncFromMolFile(OsdrTestHarness fixture, ITestOutputHelper output) : base(fixture,
                                                                                                     output)
 {
     FileId = ProcessRecordsFile(JohnId.ToString(), "Aspirin.mol",
                                 new Dictionary <string, object>()
     {
         { "parentId", JohnId }
     }).Result;
 }
コード例 #4
0
        public BlobStorageClientsTestsFixture(OsdrTestHarness harness)
        {
            using (var blobStorage = new BlobStorageClient())
            {
                blobStorage.AuthorizeClient("osdr_ml_modeler", "osdr_ml_modeler_secret").Wait();

                BlobId = blobStorage.AddResource("CLIENT_ID", "Aspirin.mol", new Dictionary <string, object>()
                {
                    { "parentId", harness.JohnId }, { "SkipOsdrProcessing", true }
                }).Result;
            }
        }
コード例 #5
0
        public BlobStorageTestsFixture(OsdrTestHarness harness)
        {
            using (var blobStorage = new BlobStorageClient())
            {
                blobStorage.Authorize("john", "qqq123").Wait();

                BlobId = blobStorage.AddResource(harness.JohnId.ToString(), "Aspirin.mol", new Dictionary <string, object>()
                {
                    { "parentId", harness.JohnId }
                }).Result;
            }
        }
コード例 #6
0
        public CreateCategoryTreeFixture(OsdrTestHarness harness)
        {
            var categories = new List <TreeNode>()
            {
                new TreeNode("Projects", new List <TreeNode>()
                {
                    new TreeNode("Projects One"),
                    new TreeNode("Projects Two")
                })
            };

            var response = harness.JohnApi.PostData("/api/categorytrees/tree", categories).Result;

            var content = response.Content.ReadAsStringAsync().Result;

            CategoryId = Guid.Parse(content);

            harness.WaitWhileCategoryTreePersisted(CategoryId);
        }
コード例 #7
0
 public GetEntitiesByCategoryId(OsdrTestHarness harness, ITestOutputHelper output, GetCategoriesIdsByEntityIdFixture fixture) : base(harness, output)
 {
     CategoryId = fixture.CategoryId;
     FileId     = fixture.FileId;
 }
コード例 #8
0
 public DeleteEntityCategoryTest(OsdrTestHarness harness, ITestOutputHelper output, DeleteEntityCategoryFixture fixture) : base(harness, output)
 {
     RootCategoryId = fixture.RootCategoryId;
     BlobId         = fixture.BlobId;
     FileId         = fixture.FileId;
 }
コード例 #9
0
 public BlobStorageClientsTests(OsdrTestHarness fixture, ITestOutputHelper output, BlobStorageClientsTestsFixture initFixture) : base(fixture, output)
 {
     BlobId = initFixture.BlobId;
 }
コード例 #10
0
 public CreateCategoryTree(OsdrTestHarness harness, ITestOutputHelper output, CreateCategoryTreeFixture fixture) : base(harness, output)
 {
     CategoryId = fixture.CategoryId;
 }
コード例 #11
0
 public AddEntityCategories(OsdrTestHarness harness, ITestOutputHelper output, AddEntityCategoriesFixture fixture) : base(harness, output)
 {
     TreeId = fixture.TreeId;
     BlobId = fixture.BlobId;
     FileId = fixture.FileId;
 }