Exemplo n.º 1
0
        public void ContainsPrefix_ReturnsTrue_IfKeyIsPresent()
        {
            // Arrange
            var values = new RouteValueDictionary(new Dictionary <string, object>
            {
                { "test-key", "test-value" }
            });
            var provider = new RouteValueProvider(BindingSource.Query, values);

            // Act
            var result = provider.ContainsPrefix("test-key");

            // Assert
            Assert.True(result);
        }
Exemplo n.º 2
0
        public void ContainsPrefix_ReturnsFalse_IfKeyIsNotPresent()
        {
            // Arrange
            var values = new RouteValueDictionary(new Dictionary<string, object>
            {
                { "test-key", "test-value" }
            });
            var provider = new RouteValueProvider(BindingSource.Query, values);

            // Act
            var result = provider.ContainsPrefix("not-test-key");

            // Assert
            Assert.False(result);
        }
Exemplo n.º 3
0
        public void ContainsPrefix_ReturnsTrue_ForKnownPrefixes(string prefix)
        {
            // Arrange
            var values = new RouteValueDictionary(new Dictionary<string, object>
            {
                { "foo", 1 },
                { "bar.baz", 1 },
            });

            var valueProvider = new RouteValueProvider(BindingSource.Query, values);

            // Act
            var result = valueProvider.ContainsPrefix(prefix);

            // Assert
            Assert.True(result);
        }
Exemplo n.º 4
0
        public void ContainsPrefix_ReturnsTrue_ForKnownPrefixes(string prefix)
        {
            // Arrange
            var values = new RouteValueDictionary(new Dictionary <string, object>
            {
                { "foo", 1 },
                { "bar.baz", 1 },
            });

            var valueProvider = new RouteValueProvider(BindingSource.Query, values);

            // Act
            var result = valueProvider.ContainsPrefix(prefix);

            // Assert
            Assert.True(result);
        }