public void autoTest_SpecificCases() { ABBA ABBAObj = new ABBA(); string[] srcs = { "B", "AB", "BBAB", "BBBBABABBBBBBA", "A" }; string[] tgts = { "ABBA", "ABB", "ABABABABB", "BBBBABABBABBBBBBABABBBBBBBBABAABBBAA", "BB" }; for (int i = 0; i < srcs.Length && i < tgts.Length; i++) { Console.WriteLine("AutoTest_ABBA.autoTest_SpecificCases: [srcs[" + i + "] | tgts[" + i + "]] = [" + srcs[i] + " | " + tgts[i] + "] ... Result = >" + ABBAObj.canObtain(srcs[i], tgts[i]) + "<"); Console.WriteLine(""); Console.WriteLine(""); } }
public void autoRandSingleTest() { ABBA ABBA_Obj = new ABBA(); int srcsize, tgtsize; do { //srcsize = PRGObj.Next(1, 999); //tgtsize = PRGObj.Next(2, 1000); srcsize = PRGObj.Next(1, 10); tgtsize = PRGObj.Next(2, 20); } while (srcsize >= tgtsize); string src = generateRandABString(srcsize); string tgt = generateRandABString(tgtsize); Console.WriteLine("AutoTest_ABBA.autoRandSingleTest: [src | tgt ] = [" + src + " | " + tgt + " ] ==> " + ABBA_Obj.canObtain(src, tgt)); }