public void RansomNoteCanBeFormedWords_CanNoteBeFormed_ReturnsFalse() { string note = " they to can "; string mag = " two systems are talking to each other, they always need to specify what encoding "; Assert.IsFalse(RansomNote.RansomNoteCanBeFormedWords(note, mag)); }
public void TestCase3() { //Arrange string fileName = "input09.txt"; string path = Path.Combine(Environment.CurrentDirectory, @"DictionariesAndHashmaps\Data\RansomNote\input\", fileName); String input = File.ReadAllText(path); var inputRows = input.Split('\n'); int magazineLength = int.Parse(inputRows[0].Trim().Split(' ')[0]); int noteLength = int.Parse(inputRows[0].Trim().Split(' ')[1]); string[] magazine = inputRows[1].Split(' '); string[] ransomNote = inputRows[2].Split(' '); string fileNameOutput = "output09.txt"; path = Path.Combine(Environment.CurrentDirectory, @"DictionariesAndHashmaps\Data\RansomNote\output\", fileNameOutput); String output = File.ReadAllText(path); //Act var result = RansomNote.CheckMagazine(magazine, ransomNote); //Assert Assert.AreEqual(result, output); }
public void DataDrivenTest(string ransomNote, string magazine, bool canConstructExpected) { var sut = new RansomNote(); bool canConstruct = sut.CanConstruct(ransomNote, magazine); canConstruct.Should().Be(canConstructExpected, $"{ransomNote} in {magazine}"); }
public void RansomNoteCanBeFormedChars_CanBeFormed_ReturnsTrue() { string note = "aabb"; string mag = "aaabb"; Assert.IsTrue(RansomNote.RansomNoteCanBeFormedChars(note, mag)); }
static void Main(string[] args) { string[] m = { "two", "times", "three", "is", "not", "four" }; string[] n = { "two", "times", "two", "is", "four" }; string result = RansomNote.Solution(m, n); Console.WriteLine(result); }
public void RansomeNoteTestMethod() { RansomNote ransomNote = new RansomNote(); Assert.AreEqual(false, ransomNote.CanConstruct("a", "b")); Assert.AreEqual(false, ransomNote.CanConstruct("a", "b")); Assert.AreEqual(true, ransomNote.CanConstruct("aa", "aab")); }
public void Test2() { string[] m = { "two", "times", "three", "is", "not", "four" }; string[] n = { "two", "times", "two", "is", "four" }; string expected = "No"; string result = RansomNote.Solution(m, n); Assert.Equal(expected, result); }
public void Test3() { string[] m = { "ive", "got", "a", "lovely", "bunch", "of", "coconuts" }; string[] n = { "ive", "got", "some", "coconuts" }; string expected = "No"; string result = RansomNote.Solution(m, n); Assert.Equal(expected, result); }
public void Test1() { string[] m = { "give", "me", "one", "grand", "today", "night" }; string[] n = { "give", "one", "grand", "today" }; string expected = "Yes"; string result = RansomNote.Solution(m, n); Assert.Equal(expected, result); }
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 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 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 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 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); }
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 RansomNoteTest() { _sut = new RansomNote(); }