Ejemplo n.º 1
0
        public void GivenSeveralInputs_ShouldReturnCorrectNumberOfTotalWords()
        {
            var subject = new Private.Thesaurus();
            var input1  = new[] { "a", "b", "c" };
            var input2  = new[] { "d", "e", "f" };

            subject.AddSynonyms(input1);
            subject.AddSynonyms(input2);

            var result = subject.GetWords();

            Assert.AreEqual(input1.Length + input2.Length, result.Count());
        }
Ejemplo n.º 2
0
        public void ValidInput_ReturnsExpectedResults()
        {
            var subject = new Private.Thesaurus();
            var input   = new[] { "a", "b", "c", "d", };

            subject.AddSynonyms(input);

            var result = subject.GetWords();

            Assert.AreEqual(
                input.Length,
                result.Count(),
                "Length of the input should be equal to length of the result");
        }
Ejemplo n.º 3
0
        public void GivenDuplicateWords_ShouldNotBeAdded()
        {
            var subject = new Private.Thesaurus();
            var input   = new[] { "a", "b" };

            subject.AddSynonyms(input);
            subject.AddSynonyms(input);

            var input2 = new[] { "a", "c", "d" };

            subject.AddSynonyms(input2);
            var result = subject.GetWords();

            Assert.AreEqual(4, result.Count());
        }