コード例 #1
0
        public void ShouldConcateString()
        {
            StringJoiner sut      = new StringJoiner();
            string       expected = "Usama Khan";

            Assert.That(sut.Join("Usama", "Khan"), Is.EqualTo(expected));
        }
コード例 #2
0
        public void ShouldCompareTwoStrings()
        {
            String       expected = "USAMA KHAN";
            StringJoiner sut      = new StringJoiner();

            sut.Join("Muhammad", "Usama");

            Assert.That(sut.Result, Is.Not.EqualTo(expected));
        }
コード例 #3
0
        public void shouldJoinNotEqualString()
        {
            var    sutStringJoiner = new StringJoiner();
            string expectedResult  = "USAMA KHAN";

            var fullName = sutStringJoiner.Join("Muhammad", "Usama");

            Assert.That(fullName, Is.Not.EqualTo(expectedResult).IgnoreCase);
        }
コード例 #4
0
        public void shouldJoinStringCaseInsentive()
        {
            var    sutStringJoiner = new StringJoiner();
            string expectedResult  = "USAMA KHAN";

            var fullName = sutStringJoiner.Join("Usama", "Khan");

            Assert.That(fullName, Is.EqualTo(expectedResult).IgnoreCase);
        }
コード例 #5
0
        public void shouldJoinString()
        {
            var    sutStringJoiner = new StringJoiner();
            string expectedResult  = "Usama Khan";

            var fullName = sutStringJoiner.Join("Usama", "Khan");

            Assert.That(fullName, Is.EqualTo(expectedResult));
        }
コード例 #6
0
        public string PrintGenreNames()
        {
            StringJoiner names = new StringJoiner(", ");

            foreach (var genre in Title.TitleGenre)
            {
                names.Join(genre.Genre.Name);
            }

            return(names.JoinedString);
        }