public static IsIsogram ( string word ) : bool | ||
word | string | |
Результат | bool |
public void ShouldHoldFalseForWordEleven() { Isogram i = new Isogram(); var actual = i.IsIsogram("eleven"); var expected = false; Assert.True(expected == actual); }
public void ShouldHoldTrueForEmptyString() { Isogram i = new Isogram(); var actual = i.IsIsogram(""); var expected = true; Assert.True(expected == actual); }
public void ShouldHoldTrueForWordWithDuplicatedFHyphenSixyearold() { Isogram i = new Isogram(); var actual = i.IsIsogram("six-year-old"); var expected = true; Assert.True(expected == actual); }
public void ShouldHoldTrueForNameWhichIsSeperatedBySpaces() { Isogram i = new Isogram(); var actual = i.IsIsogram("Ros Eckler"); var expected = true; Assert.True(expected == actual); }
public void ShouldHoldTrueForWordWithHyphenThumbscrewJapingly() { Isogram i = new Isogram(); var actual = i.IsIsogram("thumbscrew-japingly"); var expected = true; Assert.True(expected == actual); }
public void ShouldHoldTrueForWordWithDuplicatedCharacterInMixedCaseAlphabet() { Isogram i = new Isogram(); var actual = i.IsIsogram("Alphabet"); var expected = true; Assert.True(expected == actual); }
public void ShouldHoldTrueForLongReportedEnglishWordLikeSubdermatoglyphic() { Isogram i = new Isogram(); var actual = i.IsIsogram("subdermatoglyphic"); var expected = true; Assert.True(expected == actual); }
public void ShouldHoldTrueForWordIsogramWithLowerCaseCharacters() { Isogram i = new Isogram(); var actual = i.IsIsogram("isogram"); var expected = true; Assert.True(expected == actual); }
public void Isogram_IsIsogram_RandomTest() { var randomTestStr = ""; Random rnd = new Random(); var isIsogram = true; for (var i = 0; i < 100; i++) { var thisChar = rnd.Next(0, 99) < 50 ? _lowers[(rnd.Next(0, _lowers.Length))] : _uppers[(rnd.Next(0, _uppers.Length))]; if (randomTestStr.ToUpper().Contains(thisChar.ToString().ToUpper())) { isIsogram = false; } randomTestStr += thisChar; } Console.WriteLine(String.Format("Test string for Random Tests: {0}", randomTestStr)); Assert.AreEqual(isIsogram, Isogram.IsIsogram(randomTestStr)); }
public void Duplicated_character_in_the_middle() { Assert.False(Isogram.IsIsogram("accentor")); }
public void Isogram_with_duplicated_non_letter_character() { Assert.True(Isogram.IsIsogram("Hjelmqvist-Gryb-Zock-Pfund-Wax")); }
public void Word_with_duplicated_character_in_mixed_case() { Assert.False(Isogram.IsIsogram("Alphabet")); }
public void Word_with_one_duplicated_character() { Assert.False(Isogram.IsIsogram("eleven")); }
public void Same_first_and_last_characters() { Assert.False(Isogram.IsIsogram("angola")); }
public void Hypothetical_word_with_duplicated_character_following_hyphen() { Assert.False(Isogram.IsIsogram("thumbscrew-jappingly")); }
public void Word_with_one_duplicated_character_from_the_end_of_the_alphabet() { Assert.False(Isogram.IsIsogram("zzyzx")); }
public void Word_with_duplicated_character_in_mixed_case_lowercase_first() { Assert.False(Isogram.IsIsogram("alphAbet")); }
public void TestForDuplicateCharInDifferentCase() { Isogram.IsIsogram("Alphabet").Should().BeTrue(); }
public void Isogram_with_duplicated_hyphen() { Assert.True(Isogram.IsIsogram("six-year-old")); }
public void TestForStringWithHyphen() { Isogram.IsIsogram("thumbscrew-japingly").Should().BeTrue(); }
public void Isogram_with_only_lower_case_characters() { Assert.True(Isogram.IsIsogram("isogram")); }
public void TestForStringWithDuplicateHyphen() { Isogram.IsIsogram("six-year-old").Should().BeTrue(); }
public void Longest_reported_english_isogram() { Assert.True(Isogram.IsIsogram("subdermatoglyphic")); }
public void TestForStringWithSpaces() { Isogram.IsIsogram("thumbscrew japingly").Should().BeTrue(); }
public void Hypothetical_isogrammic_word_with_hyphen() { Assert.True(Isogram.IsIsogram("thumbscrew-japingly")); }
public void TestForEmptyString() { Isogram.IsIsogram("").Should().BeTrue(); }
public void Made_up_name_that_is_an_isogram() { Assert.True(Isogram.IsIsogram("Emily Jung Schwartzkopf")); }
public bool Isogram_correctly_detects_isograms(string input) { return(Isogram.IsIsogram(input)); }
public void Empty_string() { Assert.True(Isogram.IsIsogram("")); }
public void IsIsogram() { _isogram.IsIsogram("Dermatoglyphics").Should().BeTrue(); _isogram.IsIsogram("aba").Should().BeFalse(); _isogram.IsIsogram("moOse").Should().BeFalse(); }