Exemplo n.º 1
0
        public async Task TestUpdateGroup()
        {
            var groupNew = new GroupNew().SetDefaults();

            groupNew.Name        = "api.test.group." + new Guid().ToString();
            groupNew.Description = "This is a test group for the API tests.";

            var createGroupRequest  = new CreateGroupRequest(groupNew);
            var createGroupResponse = await SkyManager.ApiClient.ExecuteRequestAsync(createGroupRequest);

            var groupId = createGroupResponse.Content.Id;

            var groupUpdate = new GroupUpdate().SetDefaults();

            groupUpdate.Description = "Updated decsription";
            groupUpdate.Name        = "Update group name";
            Assert.NotNull(groupUpdate.ToJson());
            Assert.NotNull(groupUpdate.ToString());

            var updateGroupRequest  = new UpdateGroupRequest(groupUpdate, groupId);
            var updateGroupResponse = await SkyManager.ApiClient.ExecuteRequestAsync(updateGroupRequest);

            var deleteGroupRequest = new DeleteGroupRequest(groupId);
            await SkyManager.ApiClient.ExecuteRequestAsync(deleteGroupRequest);
        }