//Activate This Construntor to log All To Standard output //public TestClass():base(true){} //Activate this constructor to log Failures to a log file //public TestClass(System.IO.TextWriter tw):base(tw, false){} //Activate this constructor to log All to a log file //public TestClass(System.IO.TextWriter tw):base(tw, true){} //BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES public void run() { Exception exp = null; DataTable dtParent = GHTUtils.DataProvider.CreateParentDataTable(); UniqueConstraint uc = null; uc = new UniqueConstraint(dtParent.Columns[0],false); try { BeginCase("ToString - default"); Compare(uc.ToString(), string.Empty ); } catch(Exception ex) {exp = ex;} finally {EndCase(exp); exp = null;} uc = new UniqueConstraint("myConstraint",dtParent.Columns[0],false); try { BeginCase("Tostring - Constraint name"); Compare(uc.ToString(), "myConstraint"); } catch(Exception ex) {exp = ex;} finally {EndCase(exp); exp = null;} }
[Test] public new void ToString() { DataTable dtParent = DataProvider.CreateParentDataTable(); UniqueConstraint uc = null; uc = new UniqueConstraint(dtParent.Columns[0],false); // ToString - default Assert.AreEqual(string.Empty , uc.ToString(), "UC8"); uc = new UniqueConstraint("myConstraint",dtParent.Columns[0],false); // Tostring - Constraint name Assert.AreEqual("myConstraint", uc.ToString(), "UC9"); }