Ejemplo n.º 1
0
        public void AppliesLettersCorrectly()
        {
            var phrase = new Phrase("TEST");

            Assert.Equal("____", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('A'));
            Assert.Equal("____", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('B'));
            Assert.Equal("____", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('Z'));
            Assert.Equal("____", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('Z'));
            Assert.Equal("____", phrase.Current);
            Assert.Equal(1, phrase.ApplyLetter('E'));
            Assert.Equal("_E__", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('K'));
            Assert.Equal("_E__", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('K'));
            Assert.Equal("_E__", phrase.Current);
            Assert.Equal(1, phrase.ApplyLetter('S'));
            Assert.Equal("_ES_", phrase.Current);
            Assert.Equal(2, phrase.ApplyLetter('T'));
            Assert.Equal("TEST", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('Z'));
            Assert.Equal("TEST", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('E'));
            Assert.Equal("TEST", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('S'));
            Assert.Equal("TEST", phrase.Current);
            Assert.Equal(0, phrase.ApplyLetter('T'));
            Assert.Equal("TEST", phrase.Current);
        }