Esempio n. 1
0
        public void Corpus_FirstLetter_CorrectLetterGivenWeight(double weight, string expected)
        {
            // Arrange
            var rawData = new string[]
            {
                "dummy",
                "e,x [0.5%],a [0.4%]",
                " ,p [5.0%],a [7.5%],j [9.0%]"
            };
            var corpus = new Corpus {
                RawData = rawData
            };

            corpus.ProcessLinesToLetters();

            // Act
            var result = corpus.GetFirstLetter(weight).Letter;

            // Assert
            Assert.That(result, Is.EqualTo(expected));
        }
Esempio n. 2
0
        public void Corpus_FirstLetterTotalWeight_CorrectSum()
        {
            // Arrange
            var rawData = new string[]
            {
                "dummy",
                "e,x [0.5%],a [0.4%]",
                " ,p [5.0%],a [7.5%],j [9.0%]"
            };
            var corpus = new Corpus {
                RawData = rawData
            };

            corpus.ProcessLinesToLetters();

            // Act
            var result = corpus.FirstLetterTotalWeight;

            // Assert
            Assert.That(result, Is.EqualTo(21.5));
        }
Esempio n. 3
0
        public void Corpus_ProcessLinesToLetters_ProcessesInCorrectOrder()
        {
            // Arrange
            var rawData = new string[]
            {
                "dummy",
                "e,x [0.5%],a [0.4%]",
                "s,p [0.3%],a [0.2%],j [5.1%]"
            };
            var corpus = new Corpus {
                RawData = rawData
            };

            // Act
            corpus.ProcessLinesToLetters();

            // Assert
            Assert.That(corpus.Letters.Count, Is.EqualTo(2));
            Assert.That(corpus.Letters[0].CoreLetter, Is.EqualTo("e"));
            Assert.That(corpus.Letters[1].CoreLetter, Is.EqualTo("s"));
        }