public async Task CreateSolutionTagAsync_ExpectedResult() { CreateTagRequest req = new CreateTagRequest() { Key = "testkey", Value = "testvalue" }; IUKFastECloudClient client = Substitute.For <IUKFastECloudClient>(); client.PostAsync <Tag>("/ecloud/v1/solutions/123/tags", req).Returns(new Tag() { Key = "testkey" }); var ops = new SolutionTagOperations <Tag>(client); var tagKey = await ops.CreateSolutionTagAsync(123, req); Assert.AreEqual("testkey", tagKey); }
public async Task CreateSolutionTagAsync_InvalidSolutionID_ThrowsUKFastClientValidationException() { var ops = new SolutionTagOperations <Tag>(null); await Assert.ThrowsExceptionAsync <UKFastClientValidationException>(() => ops.CreateSolutionTagAsync(0, null)); }