示例#1
0
        public void GetAtBash(string word, string expectedWord)
        {
            // Given
            var ats = new AlephTavService();

            // When
            var actual = ats.GetAtBash(word);

            // Then
            Assert.Equal(expectedWord, actual);
        }
示例#2
0
        public void FindAtbashComplementsInTanakh()
        {
            // Given
            var ats         = new AlephTavService();
            var bookService = BookService.GetInstance();
            var books       = bookService.GetAllBooks();

            var wordList = new WordService().GetUniqueWordCountList(books).Select(i => i.Key);

            // When
            var actual = ats.FindAtbashWordFromWordlist(wordList.ToList());

            // Then
            Assert.NotEmpty(actual.Distinct());
        }
示例#3
0
        public void FindAtbashComplementsFromWordList()
        {
            // Given
            var ats      = new AlephTavService();
            var wordList = new List <string> {
                "aab", "baa", "als", "sla", "pla"
            };

            var expected = new List <string> {
                "aab", "baa", "als", "sla"
            };

            // when
            var actual = ats.FindAtbashWordFromWordlist(wordList);

            // Then
            actual.ShouldDeepEqual(expected);
        }