コード例 #1
0
        public async Task RenameSolutionTemplateAsync_ValidParameters_ExpectedResult()
        {
            IUKFastECloudClient client = Substitute.For <IUKFastECloudClient>();

            var req = new RenameTemplateRequest()
            {
                Destination = "newtemplate"
            };

            var ops = new SolutionTemplateOperations <Template>(client);
            await ops.RenameSolutionTemplateAsync(123, "testtemplate", req);

            await client.Received().PostAsync("/ecloud/v1/solutions/123/templates/testtemplate/move", req);
        }
コード例 #2
0
        public async Task RenameSolutionTemplateAsync_InvalidTemplateName_ThrowsUKFastClientValidationException()
        {
            var ops = new SolutionTemplateOperations <Template>(null);

            await Assert.ThrowsExceptionAsync <UKFastClientValidationException>(() => ops.RenameSolutionTemplateAsync(123, "", null));
        }