public void Test1() { var result = RansomNote.checkMagazine( new[] { "give", "me", "one", "grand", "today", "night" }, new[] { "give", "one", "grand", "today" }); Assert.True(result); result = RansomNote.checkMagazine( new[] { "not", "enough", "Words" }, new[] { "not", "enough", "words" }); Assert.False(result); }
public void Run() { PrintProblem(); Console.WriteLine("words on magazine: number of words on note:"); a = System.Array.ConvertAll(Console.ReadLine().Split(' '), aTemp => Convert.ToInt64(aTemp)); Console.WriteLine("Magazine:"); d = Console.ReadLine().Split(' '); Console.WriteLine("Note:"); e = Console.ReadLine().Split(' '); string result = RansomNote.checkMagazine(d, e); Console.WriteLine(); Console.WriteLine("Result:"); Console.WriteLine(result); Console.ReadKey(); }
public void RansomNoteTest5() { string[] magazine = { "there", "was", "a", "bird", "in", "my", "bedroom", "and", "I", "must", "tell", "you", "without", "a", "word", "of", "doubt", "that", "the", "bird", "is", "the", "biggest", "bird", "I", "have", "ever", "seen" }; string[] note = { "the", "bird", "is", "the", "word" }; string result = RansomNote.checkMagazine(magazine, note); Assert.AreEqual("Yes", result); }
public void RansomNoteTest4() { string[] magazine = { "give", "me", "one", "grand", "today", "night" }; string[] note = { "Give", "one", "grand", "today" }; string result = RansomNote.checkMagazine(magazine, note); Assert.AreEqual("No", result); }
public void RansomNoteTest3() { string[] magazine = { "ive", "got", "a", "lovely", "bunch", "of", "coconuts" }; string[] note = { "ive", "got", "some", "coconuts" }; string result = RansomNote.checkMagazine(magazine, note); Assert.AreEqual("No", result); }
public void RansomNoteTest2() { string[] magazine = { "two", "times", "three", "is", "not", "four" }; string[] note = { "two", "times", "two", "is", "four" }; string result = RansomNote.checkMagazine(magazine, note); Assert.AreEqual("No", result); }