public void ClassicCount() { //ANSI-SQL92 definition //COUNT < leftparen> <asterisk> < right paren> IList args = new ArrayList(); ClassicCountFunction ccf = new ClassicCountFunction(); args.Add("va1"); Assert.AreEqual("count(va1)", ccf.Render(args, factoryImpl).ToString()); args.Clear(); args.Add("*"); Assert.AreEqual("count(*)", ccf.Render(args, factoryImpl).ToString()); args.Clear(); args.Add("va1"); args.Add("va2"); try { SqlString t = ccf.Render(args, factoryImpl); Assert.Fail("No exception 2 argument without <setquantifier>:" + t); } catch (QueryException) { //correct } }
public void ClassicCount() { //ANSI-SQL92 definition //COUNT < leftparen> <asterisk> < right paren> IList args = new ArrayList(); ClassicCountFunction ccf = new ClassicCountFunction(); args.Add("va1"); Assert.AreEqual("count(va1)", ccf.Render(args, factoryImpl).ToString()); args.Clear(); args.Add("*"); Assert.AreEqual("count(*)", ccf.Render(args, factoryImpl).ToString()); args.Clear(); args.Add("va1"); args.Add("va2"); Assert.Throws <QueryException>(() => ccf.Render(args, factoryImpl), "No exception 2 argument without <setquantifier>"); }