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());
        }
        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);
        }
Esempio n. 3
0
 public ReadEventsBackwardAsyncFromMolFile(OsdrTestHarness fixture, ITestOutputHelper output) : base(fixture,
                                                                                                     output)
 {
     FileId = ProcessRecordsFile(JohnId.ToString(), "Aspirin.mol",
                                 new Dictionary <string, object>()
     {
         { "parentId", JohnId }
     }).Result;
 }
        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;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 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);
        }
Esempio n. 7
0
 public GetEntitiesByCategoryId(OsdrTestHarness harness, ITestOutputHelper output, GetCategoriesIdsByEntityIdFixture fixture) : base(harness, output)
 {
     CategoryId = fixture.CategoryId;
     FileId     = fixture.FileId;
 }
 public DeleteEntityCategoryTest(OsdrTestHarness harness, ITestOutputHelper output, DeleteEntityCategoryFixture fixture) : base(harness, output)
 {
     RootCategoryId = fixture.RootCategoryId;
     BlobId         = fixture.BlobId;
     FileId         = fixture.FileId;
 }
 public BlobStorageClientsTests(OsdrTestHarness fixture, ITestOutputHelper output, BlobStorageClientsTestsFixture initFixture) : base(fixture, output)
 {
     BlobId = initFixture.BlobId;
 }
Esempio n. 10
0
 public CreateCategoryTree(OsdrTestHarness harness, ITestOutputHelper output, CreateCategoryTreeFixture fixture) : base(harness, output)
 {
     CategoryId = fixture.CategoryId;
 }
Esempio n. 11
0
 public AddEntityCategories(OsdrTestHarness harness, ITestOutputHelper output, AddEntityCategoriesFixture fixture) : base(harness, output)
 {
     TreeId = fixture.TreeId;
     BlobId = fixture.BlobId;
     FileId = fixture.FileId;
 }