예제 #1
0
        public void LinesAreAddedToModelOnLearn()
        {
            var model = new StringMarkov();

            model.Learn(ExampleData);

            Assert.AreEqual(ExampleData.Count(), model.SourcePhrases.Count);
            CollectionAssert.AreEquivalent(ExampleData.ToList(), model.SourcePhrases);
        }
예제 #2
0
        public void LearningDuplicateLinesAreIgnored()
        {
            var model = new StringMarkov();

            model.Learn(ExampleData);
            model.Learn(ExampleData);

            Assert.AreEqual(ExampleData.Count(), model.SourcePhrases.Count);
            Assert.That(ExampleData.ToList(), Is.EquivalentTo(model.SourcePhrases));
            Assert.That(model.SourcePhrases, Is.Unique);
        }