예제 #1
0
        public async Task WhentheIMSUserpostsCollectionandresponsestatusCodeasOK()
        {
            restClientUser = "******";

            var vaultId = "JCI-Demo";

            scenarioContext.AddVaultId(vaultId);

            var accountId = "JCI-Demo";

            scenarioContext.AddAccountId(accountId);


            var headers = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("VaultId", vaultId),
                new KeyValuePair <string, string>("AccountId", accountId)
            };


            Collection collection     = new Collection(collectionName: $"test-{Guid.NewGuid()}");
            string     collectionname = collection.collectionName.ToString();

            this.scenarioContext.Set <dynamic>(collectionname, "BodyCollectionName");
            string CollectionId = $"test-{Guid.NewGuid()}";

            this.scenarioContext.Set <dynamic>(CollectionId, "CollectionsResponse");

            //Log.Information($"Attempting to post new collection");

            //var postCollectionsResponseMsg = await ERService.PostCollections(collection, headers);

            //var response = postCollectionsResponseMsg.Response.Content.ReadAsStringAsync().GetAwaiter().GetResult();

            //string CollectionId = Convert.ToString(JObject.Parse(response.ToString())["data"]["collectionId"]);
            //this.scenarioContext.Set<dynamic>(CollectionId, "CollectionsResponse");


            //postCollectionsResponseMsg.Response.StatusCode.Should().Be(HttpStatusCode.OK, $"{restClientUser} user with {_testCfg.ImsScopes} scopes should be able to post a collection");
        }