예제 #1
0
 public void CreateLinkValue_Throws_When_Uri_Is_Null()
 {
     Assert.Throws <ArgumentNullException>(
         "linkTargetUri",
         () => LinkValueHelpers.CreateLinkValue(
             null,
             "relationType",
             int.MaxValue,
             int.MaxValue));
 }
예제 #2
0
 CreateLinkValue_Throws_When_RelationType_Is_NullEmptyOrWhitespace(
     string value)
 {
     Assert.Throws <ArgumentException>(
         "relationType",
         () => LinkValueHelpers.CreateLinkValue(
             new Uri("http://localhost/"),
             value,
             int.MaxValue,
             int.MaxValue));
 }
예제 #3
0
        public void CreateLinkValue_Returns_LinkValue(
            string expected,
            string value,
            int offset,
            int limit)
        {
            var relationType = "relationType";
            var result       = LinkValueHelpers.CreateLinkValue(
                new Uri(value),
                relationType,
                offset,
                limit);

            Assert.NotNull(result);
            Assert.Contains(
                relationType,
                result.RelationType.Relations);
            Assert.Equal(
                expected,
                result.TargetUri.ToString());
        }