Example #1
0
        public void ToStringShouldStartWithACapitalLetter()
        {
            var sentence = new Sentence(
                new Word("fi"), new Word("fo"), new Word("fum"));

            Assert.Equal('F', sentence.ToString()[0]);
        }
Example #2
0
        public void GetHashCodeShouldMatchForSameObject()
        {
            var s1 = new Sentence(
                new Word("fi"), new Word("fo"), new Word("fun"));
            var s2 = new Sentence(
                new Word("fi"), new Word("fo"), new Word("fun"));

            Assert.Equal(s1.GetHashCode(), s2.GetHashCode());
        }
Example #3
0
        public void EqualsShouldWord()
        {
            var s1 = new Sentence(
                new Word("fi"), new Word("fo"), new Word("fun"));
            var s2 = new Sentence(
                new Word("fi"), new Word("fo"), new Word("fun"));

            Assert.Equal(s1, s2);
        }
Example #4
0
        public void ToStringShouldSpaceWordsWithSpaces()
        {
            var sentence = new Sentence(new Word("foo"), new Word("bar"));

            Assert.Equal("Foo bar.", sentence.ToString());
        }
Example #5
0
        public void ToStringShouldEndWithPeriod()
        {
            var sentence = new Sentence(new Word("foo"), new Word("bar"));

            Assert.Equal('.', sentence.ToString().Last());
        }