public void GetRuntimeName_IColumns_Pass() { TestColumn tc = new TestColumn(); tc.Alias = "test"; Assert.AreEqual(tc.GetRuntimeName(), "test"); tc.SelectSQL = "MangleQuery([mydb]..[myExcitingField])"; //still has Alias Assert.AreEqual(tc.GetRuntimeName(), "test"); tc.Alias = null; tc.SelectSQL = "[mydb]..[myExcitingField]"; Assert.AreEqual(tc.GetRuntimeName(), "myExcitingField"); }
public void GetRuntimeName_IColumns_ThrowBecauseMissingAliasOnScalarValueFunction() { TestColumn tc = new TestColumn(); tc.SelectSQL = "MangleQuery([mydb]..[myExcitingField])"; var ex = Assert.Throws <RuntimeNameException>(() => tc.GetRuntimeName()); }