public void IsCreateResourceMethodNoReturnType() { Assert.False(ResourceSchemaParser.IsCreateResourceMethod(CreateMethod(body: new Parameter() { Location = ParameterLocation.Body }))); }
public void IsCreateResourceMethodWithCompositeNonResourceReturnType() { Assert.False(ResourceSchemaParser.IsCreateResourceMethod(CreateMethod( body: new Parameter() { Location = ParameterLocation.Body }, responseBody: new CompositeType()))); }
public void IsCreateResourceMethodWithNonResourceReturnType() { Assert.False(ResourceSchemaParser.IsCreateResourceMethod(CreateMethod( body: new Parameter() { Location = ParameterLocation.Body }, responseBody: new PrimaryType(KnownPrimaryType.Int)))); }
public void IsCreateResourceMethodWithResourceReturnTypeButNoUrl() { CompositeType responseBody = new CompositeType(); responseBody.Extensions.Add("x-ms-azure-resource", true); Assert.False(ResourceSchemaParser.IsCreateResourceMethod(CreateMethod( body: new Parameter() { Location = ParameterLocation.Body }, responseBody: responseBody))); }
public void IsCreateResourceMethodWhenUrlDoesntEndWithResourceNamePlaceholder() { CompositeType responseBody = new CompositeType(); responseBody.Extensions.Add("x-ms-azure-resource", true); Assert.False(ResourceSchemaParser.IsCreateResourceMethod(CreateMethod( body: new Parameter() { Location = ParameterLocation.Body }, responseBody: responseBody, url: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames"))); }
public void IsCreateResourceMethodWithResourceReturnTypeAndUrl() { CompositeType responseBody = new CompositeType(); responseBody.Extensions.Add("x-ms-azure-resource", true); Assert.True(ResourceSchemaParser.IsCreateResourceMethod(CreateMethod( body: new Parameter() { Location = ParameterLocation.Body }, responseBody: responseBody, url: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Mock.Provider/mockResourceNames/{mockResourceName}"))); }
public void IsCreateResourceMethodWithNoBody() { Assert.False(ResourceSchemaParser.IsCreateResourceMethod(CreateMethod())); }
public void IsCreateResourceMethodWithGetHttpMethod() { Assert.False(ResourceSchemaParser.IsCreateResourceMethod(CreateMethod(HttpMethod.Get))); }
public void IsCreateResourceMethodWithNullMethod() { Assert.Throws <ArgumentNullException>(() => { ResourceSchemaParser.IsCreateResourceMethod(null); }); }