public void CreateSwaggerPathForOperationImport_ReturnsSwaggerObject() { // Arrange & Act JObject obj = ODataSwaggerUtilities.CreateSwaggerPathForOperationImport(_getCustomers); // Assert Assert.NotNull(obj); Assert.Contains("\"Call operation import GetCustomers\"", obj.ToString()); }
public void CreateSwaggerPathForOperationOfEntity_ReturnsSwaggerObject() { // Arrange & Act JObject obj = ODataSwaggerUtilities.CreateSwaggerPathForOperationOfEntity(_isCustomerUpgradedWithParam, _customers); // Assert Assert.NotNull(obj); Assert.Contains("\"Call operation IsUpgradedWithParam\"", obj.ToString()); }
public void CreateSwaggerPathForEntitySet_ReturnsEmptyObject_IfNavigationSourceNull() { // Arrange & Act JObject obj = ODataSwaggerUtilities.CreateSwaggerPathForEntitySet(navigationSource: null); // Assert Assert.NotNull(obj); Assert.Equal(new JObject(), obj); }
public void CreateSwaggerPathForEntity_ReturnsSwaggerObject() { // Arrange & Act JObject obj = ODataSwaggerUtilities.CreateSwaggerPathForEntity(_customers); // Assert Assert.NotNull(obj); Assert.Contains("\"Get entity from Customers by key.\"", obj.ToString()); }
public void CreateSwaggerDefinitionForStructureType_ReturnsSwaggerObject() { // Arrange & Act JObject obj = ODataSwaggerUtilities.CreateSwaggerTypeDefinitionForStructuredType(_customer); // Assert Assert.NotNull(obj); Assert.Contains("\"$ref\": \"#/definitions/NS.Address\"", obj.ToString()); }
public void GetPathForOperationOfEntity_Returns() { // Arrange & Act string path = ODataSwaggerUtilities.GetPathForOperationOfEntity(_isCustomerUpgradedWithParam, _customers); // Assert Assert.NotNull(path); Assert.Equal("/Customers({ID})/NS.IsUpgradedWithParam(city='{city}')", path); }
public void GetPathForOperationOfEntitySet_Returns() { // Arrange & Act string path = ODataSwaggerUtilities.GetPathForOperationOfEntitySet(_isAnyUpgraded, _customers); // Assert Assert.NotNull(path); Assert.Equal("/Customers/NS.IsAnyUpgraded()", path); }
public void GetPathForOperationImport_Returns() { // Arrange & Act string path = ODataSwaggerUtilities.GetPathForOperationImport(_getCustomers); // Assert Assert.NotNull(path); Assert.Equal("/GetCustomers()", path); }
public void GetPathForEntity_Returns() { // Arrange & Act string path = ODataSwaggerUtilities.GetPathForEntity(_customers); // Assert Assert.NotNull(path); Assert.Equal("/Customers({ID})", path); }
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) { Contract.Assume(operation != null); Contract.Assume(schemaRegistry != null); Contract.Assume(apiDescription != null); if (HasEnableQueryAttribute(apiDescription) && !HasAnyQueryOptionParameters(operation)) { operation.parameters = ODataSwaggerUtilities.AddQueryOptionParameters(operation.parameters ?? new List <Parameter>()); } }