public void WhenCallUmbrellaApiToDefineMembers(Table table)
        {
            var parent = context.Get <Models.Company>("parent").Id;
            var admin  = config.UmbrellaAdmin;
            var cs     = table.CreateSet <Models.Company>().Map(x => x.Id).ToList();
            var req    = new UmbrellaDefinitionRequest(parent, cs);
            var res    = api.CreateUmbrellaWithHttpInfo(admin, req);

            res.StatusCode.ShouldBe(HttpStatusCode.Created);
        }
Пример #2
0
        public void WhenUmbrellaIsCreatedAsFollows(Table table)
        {
            var parentId = TableUtils.Get(table, "parent");
            var children = TableUtils.Get(table, "children").Split(',').Map(s => s.Trim());
            var baseurl  = TestSetup.Config.datahubUmbrellaApi.baseurl;
            var api      = new DefaultApi(baseurl);

            try
            {
                api.DeleteUmbrellaWithHttpInfo(parentId)
                .StatusCode.ShouldBe(HttpStatusCode.OK);
            }
            catch (ApiException e)
            {
                e.ErrorCode.ShouldBe(404);
            }

            var request = new UmbrellaDefinitionRequest(parentId, children.ToList());

            api.CreateUmbrellaWithHttpInfo(request)
            .StatusCode.ShouldBe(HttpStatusCode.OK);
        }