示例#1
0
        public async Task MlProcessing_ModelTraining_AllGenericEntities()
        {
            var models = await Fixture.GetDependentFilesExcept(_testFixture.FolderId, FileType.Image, FileType.Tabular, FileType.Pdf);

            foreach (var modelId in models)
            {
                var model = await Session.Get <Model>(modelId);

                model.Should().NotBeNull();
                model.Status.Should().Be(ModelStatus.Processed);

                var responseSetPublic = JohnApi.SetPublicModelsEntity(modelId, true).GetAwaiter().GetResult();
                Harness.WaitWhileModelShared(modelId);
                responseSetPublic.EnsureSuccessStatusCode();
            }

            var response = await JohnApi.GetPublicEntity("models");

            var nodesContent = await response.Content.ReadAsStringAsync();

            var entities = JToken.Parse(nodesContent);

            entities.Should().HaveCount(1);


            await Task.CompletedTask;
        }
示例#2
0
        public async Task FileSharing_CheckPageForEntityMe_ReturnsPaginationHeader()
        {
            const int currentPage = 1;
            const int pageSize    = 100;

            var response = await JohnApi.GetPublicEntity("files", currentPage, pageSize);

            response.EnsureSuccessStatusCode();

            var json       = JToken.Parse(await response.Content.ReadAsStringAsync());
            var totalCount = json.ContainsNodes(_testFixture.InternalIds);

            totalCount.ShouldBeEquivalentTo(2);

            var paginationHeader = response.Headers.GetValues("X-Pagination").Single();
            var jsonPagination   = JObject.Parse(paginationHeader);

            jsonPagination.Should().ContainsJson($@"
            {{
                'pageSize': {pageSize},
                'totalPages': 1,
                'currentPage': {currentPage}
            }}");
//                'totalCount': {json.Count()},
        }
示例#3
0
        public async Task FileSharing_UseFilter_ReturnsOnlyIndexTwo()
        {
            var response = await JohnApi.GetPublicEntity("Records", 1, 20, "Status eq 'Failed'");

            response.EnsureSuccessStatusCode();

            var files = JToken.Parse(await response.Content.ReadAsStringAsync());

            files.ContainsNodes(_testFixture.InternalIds).ShouldBeEquivalentTo(1);
        }
示例#4
0
        public async Task FileSharing_GetThreeRecords_ReturnsOnlyThreeRecords()
        {
            var response = await JohnApi.GetPublicEntity("Records");

            response.EnsureSuccessStatusCode();

            var records = JToken.Parse(await response.Content.ReadAsStringAsync());

            records.ContainsNodes(_testFixture.InternalIds).ShouldBeEquivalentTo(2);
        }
示例#5
0
        public async Task FileSharing_GetEmptyFolders_ReturnsOnlyEmptyFolders()
        {
            var response = await JohnApi.GetPublicEntity("Folders");

            response.EnsureSuccessStatusCode();

            var folders = JToken.Parse(await response.Content.ReadAsStringAsync());

            folders.ContainsNodes(_testFixture.InternalIds).ShouldBeEquivalentTo(0);
        }
示例#6
0
        public async Task FileSharing_UseProjection_ReturnsFieldOnlyType()
        {
            var response = await JohnApi.GetPublicEntity("Records", 1, 20, null, "Type");

            response.EnsureSuccessStatusCode();

            var files = JToken.Parse(await response.Content.ReadAsStringAsync());

            files.ContainsNodes(_testFixture.InternalIds).ShouldBeEquivalentTo(2);

            foreach (var item in files)
            {
                item.Should().HaveCount(2);
                item["type"].ToObject <string>().ShouldBeEquivalentTo("Structure");
            }
        }