Пример #1
0
        public void ExtensionMethodForBeContainedInTest()
        {
            'a'.BeContainedIn('a', 'b', 'c').ShouldBeTrue();
            'a'.BeContainedIn('b', 'c', 'd').ShouldBeFalse();

            'a'.BeNotContainedIn('a', 'b', 'c').ShouldBeFalse();
            'a'.BeNotContainedIn('b', 'c', 'd').ShouldBeTrue();

            'a'.BeContainedIn(ArrayCreator.Of('a', 'b', 'c'), IgnoreCase.FALSE).ShouldBeTrue();
            'a'.BeContainedIn(ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.FALSE).ShouldBeFalse();

            'a'.BeNotContainedIn(ArrayCreator.Of('a', 'b', 'c'), IgnoreCase.FALSE).ShouldBeFalse();
            'a'.BeNotContainedIn(ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.FALSE).ShouldBeTrue();

            'a'.BeContainedIn(ArrayCreator.Of('a', 'b', 'c'), IgnoreCase.TRUE).ShouldBeTrue();
            'a'.BeContainedIn(ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.TRUE).ShouldBeFalse();

            'a'.BeNotContainedIn(ArrayCreator.Of('a', 'b', 'c'), IgnoreCase.TRUE).ShouldBeFalse();
            'a'.BeNotContainedIn(ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.TRUE).ShouldBeTrue();
        }
Пример #2
0
        public void BeContainedInWithIgnoreCaseTest()
        {
            Chars.BeContainedIn('a', ArrayCreator.Of('a', 'b', 'c'), IgnoreCase.FALSE).ShouldBeTrue();
            Chars.BeContainedIn('a', ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.FALSE).ShouldBeFalse();

            Chars.BeNotContainedIn('a', ArrayCreator.Of('a', 'b', 'c'), IgnoreCase.FALSE).ShouldBeFalse();
            Chars.BeNotContainedIn('a', ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.FALSE).ShouldBeTrue();

            Chars.BeContainedIn('a', ArrayCreator.Of('A', 'b', 'c'), IgnoreCase.FALSE).ShouldBeFalse();
            Chars.BeContainedIn('a', ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.FALSE).ShouldBeFalse();

            Chars.BeNotContainedIn('a', ArrayCreator.Of('A', 'b', 'c'), IgnoreCase.FALSE).ShouldBeTrue();
            Chars.BeNotContainedIn('a', ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.FALSE).ShouldBeTrue();

            Chars.BeContainedIn('a', ArrayCreator.Of('A', 'b', 'c'), IgnoreCase.TRUE).ShouldBeTrue();
            Chars.BeContainedIn('a', ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.TRUE).ShouldBeFalse();

            Chars.BeNotContainedIn('a', ArrayCreator.Of('A', 'b', 'c'), IgnoreCase.TRUE).ShouldBeFalse();
            Chars.BeNotContainedIn('a', ArrayCreator.Of('b', 'c', 'd'), IgnoreCase.TRUE).ShouldBeTrue();
        }