Exemplo n.º 1
0
        public void MatchesLocationReturnsTrueWhenBothLocationLacksForwardSlashTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/time");
            var target           = new RelaxedFolderLocationValidator();
            var actualLocation   = new Uri("http://www.test.com/some/time?stuff=true");

            var actual = target.Matches(actualLocation, expectedLocation);

            actual.Should().BeTrue();
        }
Exemplo n.º 2
0
        public void MatchesLocationReturnsFalseWhenMatchingExpectedLocationFolderAgainstActualLocationFileTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/time/");
            var target           = new RelaxedFolderLocationValidator();
            var actualLocation   = new Uri("http://www.test.com/some/time/test.txt");

            var actual = target.Matches(actualLocation, expectedLocation);

            actual.Should().BeFalse();
        }
Exemplo n.º 3
0
        public void MatchesLocationThrowsExceptionWithNullActualLocationTest()
        {
            var actualLocation = new Uri("http://www.test.com/some/time");

            var target = new RelaxedFolderLocationValidator();

            Action action = () => target.Matches(actualLocation, (Uri)null);

            action.ShouldThrow <ArgumentNullException>();
        }
Exemplo n.º 4
0
        public void MatchesLocationThrowsExceptionWithNullExpectedLocationTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/Time");

            var target = new RelaxedFolderLocationValidator();

            Action action = () => target.Matches(null, expectedLocation);

            action.ShouldThrow <ArgumentNullException>();
        }
Exemplo n.º 5
0
        public void MatchesLocationReturnsTrueWithCaseInsensitiveHostMatchingTest()
        {
            var expectedLocation = new Uri("http://www.TEST.com/some/time/");
            var target           = new RelaxedFolderLocationValidator();
            var actualLocation   = new Uri("http://www.test.com/some/time/?stuff=true");

            var actual = target.Matches(actualLocation, expectedLocation);

            actual.Should().BeTrue();
        }
Exemplo n.º 6
0
        public void MatchesExpressionsThrowsExceptionTest()
        {
            var actualLocation = new Uri("http://www.test.com/some/time/");

            var target = new RelaxedFolderLocationValidator();

            Action action = () => target.Matches(actualLocation, new List <Regex>());

            action.ShouldThrow <NotImplementedException>();
        }
        public void MatchesExpressionsThrowsExceptionTest()
        {
            var actualLocation = new Uri("http://www.test.com/some/time/");

            var target = new RelaxedFolderLocationValidator();

            Action action = () => target.Matches(actualLocation, new List<Regex>());

            action.ShouldThrow<NotImplementedException>();
        }
Exemplo n.º 8
0
        public void MatchesLocationReturnsTrueWhenIgnoringQueryStringTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/time/");
            var target           = new RelaxedFolderLocationValidator();
            var actualLocation   = new Uri("http://www.test.com/some/time/?stuff=true");

            var actual = target.Matches(actualLocation, expectedLocation);

            actual.Should().BeTrue();
        }
        public void MatchesLocationReturnsFalseWhenMatchingExpectedLocationFolderAgainstActualLocationFileTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/time/");
            var target = new RelaxedFolderLocationValidator();
            var actualLocation = new Uri("http://www.test.com/some/time/test.txt");

            var actual = target.Matches(actualLocation, expectedLocation);

            actual.Should().BeFalse();
        }
Exemplo n.º 10
0
        public void MatchesLocationThrowsExceptionWithRelativeExpectedLocationTest()
        {
            var actualLocation   = new Uri("http://www.test.com/some/time");
            var expectedLocation = new Uri("/some/Time", UriKind.Relative);

            var target = new RelaxedFolderLocationValidator();

            Action action = () => target.Matches(actualLocation, expectedLocation);

            action.ShouldThrow <ArgumentException>();
        }
        public void MatchesLocationReturnsTrueWhenBothLocationLacksForwardSlashTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/time");
            var target = new RelaxedFolderLocationValidator();
            var actualLocation = new Uri("http://www.test.com/some/time?stuff=true");

            var actual = target.Matches(actualLocation, expectedLocation);

            actual.Should().BeTrue();
        }
Exemplo n.º 12
0
        public void ValidationTypeIdentifiesUriOnlyTest()
        {
            var target = new RelaxedFolderLocationValidator();

            target.ValidationType.Should().Be(LocationValidationType.UriOnly);
        }
        public void MatchesLocationReturnsTrueWhenIgnoringQueryStringTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/time/");
            var target = new RelaxedFolderLocationValidator();
            var actualLocation = new Uri("http://www.test.com/some/time/?stuff=true");

            var actual = target.Matches(actualLocation, expectedLocation);

            actual.Should().BeTrue();
        }
        public void ValidationTypeIdentifiesUriOnlyTest()
        {
            var target = new RelaxedFolderLocationValidator();

            target.ValidationType.Should().Be(LocationValidationType.UriOnly);
        }
        public void MatchesLocationThrowsExceptionWithRelativeExpectedLocationTest()
        {
            var actualLocation = new Uri("http://www.test.com/some/time");
            var expectedLocation = new Uri("/some/Time", UriKind.Relative);

            var target = new RelaxedFolderLocationValidator();

            Action action = () => target.Matches(actualLocation, expectedLocation);

            action.ShouldThrow<ArgumentException>();
        }
        public void MatchesLocationThrowsExceptionWithNullExpectedLocationTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/Time");

            var target = new RelaxedFolderLocationValidator();

            Action action = () => target.Matches(null, expectedLocation);

            action.ShouldThrow<ArgumentNullException>();
        }
        public void MatchesLocationThrowsExceptionWithNullActualLocationTest()
        {
            var actualLocation = new Uri("http://www.test.com/some/time");

            var target = new RelaxedFolderLocationValidator();

            Action action = () => target.Matches(actualLocation, (Uri)null);

            action.ShouldThrow<ArgumentNullException>();
        }
        public void MatchesLocationReturnsTrueWithCaseInsensitivePathMatchingTest()
        {
            var expectedLocation = new Uri("http://www.test.com/some/Time");
            var actualLocation = new Uri("http://www.test.com/some/time");

            var target = new RelaxedFolderLocationValidator();

            var actual = target.Matches(actualLocation, expectedLocation);

            actual.Should().BeTrue();
        }