private void RunTests(IURLifier answer, IEnumerable<Tuple<string, string>> inputOutput) { foreach(var vals in inputOutput) { Assert.AreEqual(answer.URLify(vals.Item1), vals.Item2); } }
protected override void TimingMode(string[] args) { var testObjs = new IURLifier[] { new URLRealWorld(), new URLSelfImplemented() }; foreach(var testObj in testObjs) { double avgTime = Time(testObj.URLify, (int _) => GetTestString()); Console.WriteLine($"{testObj.GetType().ToString(),40} : {avgTime:N5} ms"); } Console.ReadKey(); }