コード例 #1
0
ファイル: ODataPathTest.cs プロジェクト: ZhaoYngTest01/WebApi
        public void ToStringWithNoSegments()
        {
            // Arrange
            ODataPath path = new ODataPath();

            // Act
            string value = path.ToString();

            // Assert
            Assert.Empty(value);
        }
コード例 #2
0
        public void ToStringWithNoSegments()
        {
            // Arrange
            ODataPath path = new ODataPath();

            // Act
            string value = path.ToString();

            // Assert
            Assert.Empty(value);
        }
コード例 #3
0
ファイル: ODataPathTest.cs プロジェクト: ZhaoYngTest01/WebApi
        public void ToStringWithOneSegment()
        {
            // Arrange
            string expectedValue = "Set";
            ODataPath path = new ODataPath(new EntitySetPathSegment(expectedValue));

            // Act
            string value = path.ToString();

            // Assert
            Assert.Equal(expectedValue, value);
        }
コード例 #4
0
        public void ToStringWithOneSegment()
        {
            // Arrange
            string    expectedValue = "Set";
            ODataPath path          = new ODataPath(new EntitySetPathSegment(expectedValue));

            // Act
            string value = path.ToString();

            // Assert
            Assert.Equal(expectedValue, value);
        }
コード例 #5
0
ファイル: ODataPathTest.cs プロジェクト: ZhaoYngTest01/WebApi
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
ファイル: ODataPathTest.cs プロジェクト: ZhaoYngTest01/WebApi
        public void ToStringWithOneTwoSegments()
        {
            // Arrange
            string expectedFirstSegment = "Set";
            string expectedSecondSegment = "Action";
            ODataPath path = new ODataPath(new EntitySetPathSegment(expectedFirstSegment),
                new ActionPathSegment(expectedSecondSegment));

            // Act
            string value = path.ToString();

            // Assert
            string expectedValue = expectedFirstSegment + "/" + expectedSecondSegment;
            Assert.Equal(expectedValue, value);
        }
コード例 #8
0
        public void ToStringWithOneTwoSegments()
        {
            // Arrange
            string    expectedFirstSegment  = "Set";
            string    expectedSecondSegment = "Action";
            ODataPath path = new ODataPath(new EntitySetPathSegment(expectedFirstSegment),
                                           new ActionPathSegment(expectedSecondSegment));

            // Act
            string value = path.ToString();

            // Assert
            string expectedValue = expectedFirstSegment + "/" + expectedSecondSegment;

            Assert.Equal(expectedValue, value);
        }
コード例 #9
0
 /// <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();
 }
コード例 #10
0
 /// <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());
 }