/// <summary> /// Converts an instance of <see cref="ODataPath" /> into an OData link. /// </summary> /// <param name="path">The OData path to convert into a link.</param> /// <returns> /// The generated OData link. /// </returns> public virtual string Link(ODataPath path) { if (path == null) { throw Error.ArgumentNull("path"); } return path.ToString(); }
/// <summary> /// Converts an instance of <see cref="ODataPath" /> into an OData link. /// </summary> /// <param name="path">The OData path to convert into a link.</param> /// <returns> /// The generated OData link. /// </returns> public virtual string Link(ODataPath path) { if (path == null) { throw Error.ArgumentNull("path"); } return(path.ToString()); }
public void ToStringWithNoSegments() { // Arrange ODataPath path = new ODataPath(); // Act string value = path.ToString(); // Assert Assert.Empty(value); }
public void ToStringWithOneSegment() { // Arrange ODataPath path = new ODataPath(MetadataSegment.Instance); // Act string value = path.ToString(); // Assert Assert.Equal("$metadata", value); }
public void ToStringWithNoSegments() { // Arrange ODataPath path = new ODataPath(); // Act string value = path.ToString(); // Assert Assert.Empty(value); }
public void ToStringWithOneSegment() { // Arrange string expectedValue = "Set"; ODataPath path = new ODataPath(new EntitySetPathSegment(expectedValue)); // Act string value = path.ToString(); // Assert Assert.Equal(expectedValue, value); }
public void ToStringWithOneSegment() { // Arrange string expectedValue = "Set"; ODataPath path = new ODataPath(new EntitySetPathSegment(expectedValue)); // Act string value = path.ToString(); // Assert Assert.Equal(expectedValue, value); }
public void ToStringWithKeyValueSegment() { // Arrange string segment = "1"; ODataPath path = new ODataPath(new KeyValuePathSegment(segment)); // Act string value = path.ToString(); // Assert string expectedValue = "(" + segment + ")"; Assert.Equal(expectedValue, value); }
public void ToStringWithKeyValueSegment() { // Arrange string segment = "1"; ODataPath path = new ODataPath(new KeyValuePathSegment(segment)); // Act string value = path.ToString(); // Assert string expectedValue = "(" + segment + ")"; Assert.Equal(expectedValue, value); }
public void ToStringWithOneTwoSegments() { // Arrange string expectedFirstSegment = "Set"; string expectedSecondSegment = "Action"; ODataPath path = new ODataPath(new EntitySetPathSegment(expectedFirstSegment), new BoundActionPathSegment(expectedSecondSegment)); // Act string value = path.ToString(); // Assert string expectedValue = expectedFirstSegment + "/" + expectedSecondSegment; Assert.Equal(expectedValue, value); }
public void ToStringWithOneTwoSegments() { // Arrange string expectedFirstSegment = "Set"; string expectedSecondSegment = "Action"; ODataPath path = new ODataPath(new EntitySetPathSegment(expectedFirstSegment), new BoundActionPathSegment(expectedSecondSegment)); // Act string value = path.ToString(); // Assert string expectedValue = expectedFirstSegment + "/" + expectedSecondSegment; Assert.Equal(expectedValue, value); }
public void ToStringWithOneTwoSegments() { // Arrange EdmEntityType entityType = new EdmEntityType("NS", "entity"); EdmEntityContainer container = new EdmEntityContainer("NS", "default"); EdmEntitySet entitySet = new EdmEntitySet(container, "set", entityType); EdmAction action = new EdmAction("NS", "action", null, true, null); ODataPath path = new ODataPath(new EntitySetSegment(entitySet), new OperationSegment(new[] { action }, null)); // Act string value = path.ToString(); // Assert Assert.Equal("set/NS.action", value); }
public void ToStringWithKeyValueSegment() { // Arrange EdmEntityType entityType = new EdmEntityType("NS", "entity"); entityType.AddKeys(entityType.AddStructuralProperty("ID", EdmPrimitiveTypeKind.Int32)); var keys = new[] { new KeyValuePair <string, object>("ID", 1) }; ODataPath path = new ODataPath(new KeySegment(keys, entityType, null)); // Act string value = path.ToString(); // Assert string expectedValue = "(" + 1 + ")"; Assert.Equal(expectedValue, value); }
/// <summary> /// Converts an instance of <see cref="ODataPath" /> into an OData link. /// </summary> /// <param name="path">The OData path to convert into a link.</param> /// <returns> /// The generated OData link. /// </returns> public virtual string Link(ODataPath path) { return path.ToString(); }
/// <summary> /// Converts an instance of <see cref="ODataPath" /> into an OData link. /// </summary> /// <param name="path">The OData path to convert into a link.</param> /// <returns> /// The generated OData link. /// </returns> public virtual string Link(ODataPath path) { return(path.ToString()); }