コード例 #1
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);
        }
コード例 #2
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());
        }
コード例 #3
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);
        }