public void CollectionContainsPrefix_EmptyCollectionReturnsFalse()
        {
            // Arrange
            string[] collection = new string[0];

            // Act
            bool retVal = ValueProviderUtil.CollectionContainsPrefix(collection, "");

            // Assert
            Assert.False(retVal);
        }
        public void CollectionContainsPrefix_NonEmptyCollectionReturnsTrueIfPrefixIsEmptyString()
        {
            // Arrange
            string[] collection = new string[] { "Hello" };

            // Act
            bool retVal = ValueProviderUtil.CollectionContainsPrefix(collection, "");

            // Assert
            Assert.True(retVal);
        }
        public void CollectionContainsPrefix_MatchIsNotSimpleSubstringMatch()
        {
            // Arrange
            string[] collection = new string[] { "Hello" };

            // Act
            bool retVal = ValueProviderUtil.CollectionContainsPrefix(collection, "He");

            // Assert
            Assert.False(retVal);
        }
        public void CollectionContainsPrefix_MatchIsCaseInsensitive()
        {
            // Arrange
            string[] collection = new string[] { "Hello" };

            // Act
            bool retVal = ValueProviderUtil.CollectionContainsPrefix(collection, "hello");

            // Assert
            Assert.True(retVal);
        }
        public void CollectionContainsPrefix_ExactMatch()
        {
            // Arrange
            string[] collection = new string[] { "Hello" };

            // Act
            bool retVal = ValueProviderUtil.CollectionContainsPrefix(collection, "Hello");

            // Assert
            Assert.True(retVal);
        }
Exemplo n.º 6
0
        public void CollectionContainsPrefix_PrefixBoundaries()
        {
            // Arrange
            string[] collection = new string[] { "Hello.There[0]" };

            // Act
            bool retVal1 = ValueProviderUtil.CollectionContainsPrefix(collection, "hello");
            bool retVal2 = ValueProviderUtil.CollectionContainsPrefix(collection, "hello.there");

            // Assert
            Assert.IsTrue(retVal1);
            Assert.IsTrue(retVal2);
        }