示例#1
0
        public void Match_WithPairHavingNegativeMatchNumber_ShouldNotThrowException()
        {
            var pairs = new MatchPair[]
            {
                new MatchPair(2, "Fizz"),
                new MatchPair(-1, "Fizzer"),
            };

            Assert.DoesNotThrow(() => _sut.Match(pairs, 1).ToList());
        }
示例#2
0
        public void Match_WithPairHavingNegativeMatchNumber_ShouldMatch()
        {
            const string invalidText = "Fizzer";
            var          pairs       = new MatchPair[]
            {
                new MatchPair(2, "Fizz"),
                new MatchPair(-1, invalidText),
            };

            var replacements = _sut.Match(pairs, 2).ToList();

            Assert.AreEqual(2, replacements.Count(r => r.Contains(invalidText)));
        }
示例#3
0
        public void Match_WithPairsHavingZeroForMatchNumber_ShouldNotThrowException()
        {
            var pairs = new MatchPair[]
            {
                new MatchPair(0, "Fizz"),
                new MatchPair()
                {
                    TextContent = "Fizz2"
                }
            };

            Assert.DoesNotThrow(() => _sut.Match(pairs, 1).ToList());
        }