public void ScalarDestinationTest() { TestAccessor ta = TestAccessor.CreateInstance(); int id1; int id2; id1 = ta.ScalarDestination1(out id2); Assert.AreEqual(id1, 12345); Assert.AreEqual(id2, 12345); ta.ScalarDestination2(out id2); Assert.AreEqual(id2, 12345); id1 = (int)ta.ScalarDestination3(out id2); Assert.AreEqual(id1, 12345); Assert.AreEqual(id2, 12345); id2 = 0; id1 = ta.ScalarDestination4(ref id2); Assert.AreEqual(id1, 12345); Assert.AreEqual(id2, 12345); id2 = 0; ta.ScalarDestination5(ref id2); Assert.AreEqual(id2, 12345); id2 = 0; id1 = (int)ta.ScalarDestination6(ref id2); Assert.AreEqual(id1, 12345); Assert.AreEqual(id2, 12345); }
public void Test() { TestAccessor ta = DataAccessor.CreateInstance <TestAccessor>(); Person p = ta.SelectByName("Tester", "Testerson"); Assert.AreEqual(2, p.ID); }
public void ScalarDictionaryByPKTest() { TestAccessor da = (TestAccessor)DataAccessor.CreateInstance(typeof(TestAccessor)); // Exception here: // Index is not defined for the method 'TestAccessor.ScalarDictionaryByPK' da.ScalarDictionaryByPK(); }
public void KeylessTest() { TestAccessor da = (TestAccessor)DataAccessor.CreateInstance(typeof(TestAccessor)); // Exception here: // Index is not defined for the method 'TestAccessor.Keyless' da.Keyless(); }
public void Test() { TestAccessor pa = DataAccessor.CreateInstance <TestAccessor>(); IDictionary <int, string> dic = pa.GetPersonNameDictionary(); Assert.AreEqual("John", dic[1]); }
public void Test1() { TestAccessor ta = DataAccessor.CreateInstance <TestAccessor> /*[a]*/ () /*[/a]*/; Person person = ta.SelectByKey(1); Assert.IsNotNull(person); }
public void Test() { TestAccessor ta = DataAccessor.CreateInstance <TestAccessor>(); List <Person> list = ta.GetPersonList(); Assert.AreNotEqual(0, list.Count); }
public void DataReaderTest() { TestAccessor ta = TestAccessor.CreateInstance(); int expectedValue = 12345; int actualValue = ta.Scalar_DataReader(); Assert.AreEqual(expectedValue, actualValue); }
public void OutputParameterTest() { TestAccessor ta = TestAccessor.CreateInstance(); int expectedValue = 12345; int actualValue = ta.Scalar_OutputParameter(); Assert.AreEqual(expectedValue, actualValue); }
public void AffectedRowsTest() { TestAccessor ta = TestAccessor.CreateInstance(); int expectedValue = -1; int actualValue = ta.Scalar_AffectedRows(); Assert.AreEqual(expectedValue, actualValue); }
public void DataReader3Test() { TestAccessor ta = TestAccessor.CreateInstance(); string expectedValue = "54321"; string actualValue = ta.Scalar_DataReader3(); Assert.AreEqual(expectedValue, actualValue); }
public void OutputParameter2Test() { TestAccessor ta = TestAccessor.CreateInstance(); string expectedValue = "54321"; string actualValue = ta.Scalar_OutputParameter2(); Assert.AreEqual(expectedValue, actualValue); }
public void ScalarNullableDestinationTest() { TestAccessor ta = TestAccessor.CreateInstance(); int?id1; int?id2 = -1; id1 = ta.ScalarNullableDestination(ref id2); Assert.AreEqual(id1, id2); }
public void ScalarNullableEnumDestinationTest() { TestAccessor ta = TestAccessor.CreateInstance(); TestEnum?refVal = null; TestEnum?outVal = ta.ScalarNullableEnumDestination(ref refVal); Assert.That(outVal, Is.EqualTo(TestEnum.Value)); Assert.That(refVal, Is.EqualTo(TestEnum.Value)); }
public void GenericsSelectIDsTest() { using (DbManager db = new DbManager()) { TestAccessor ta = TestAccessor.CreateInstance(); List <int> list = ta.GenericsSelectIDs(db); Assert.IsNotNull(list); Assert.IsNotEmpty(list); } }
public void Test3() { using (DbManager db = new DbManager()) { TestAccessor ta = DataAccessor.CreateInstance <TestAccessor> /*[a]*/ () /*[/a]*/; Person person = ta.SelectByKey(/*[a]*/ db /*[/a]*/, 1); Assert.IsNotNull(person); } }
public void Test() { TestAccessor ta = DataAccessor.CreateInstance <TestAccessor>(); Assert.IsTrue(ta.GetName1() is Name1); Assert.IsTrue(ta.GetName2() is Name2); Assert.IsTrue(ta.GetName1List()[0] is Name1); Assert.IsTrue(ta.GetName2List()[0] is Name2); Assert.IsTrue(ta.GetName1Dictionary()[1] is Name1); Assert.IsTrue(ta.GetName2Dictionary()[1] is Name2); }
public void SelectLastNamesTest() { using (DbManager db = new DbManager()) { TestAccessor ta = TestAccessor.CreateInstance(); ArrayList list = ta.SelectLastNames(db); Assert.IsNotNull(list); Assert.IsNotEmpty(list); Assert.IsTrue(list[0] is string); } }
public void XmlDocTest() { using (DbManager db = new DbManager()) { TestAccessor ta = TestAccessor.CreateInstance(); XmlDocument xmlDocument = ta.GetXmlDoc(db, 2); Assert.IsNotNull(xmlDocument); Assert.IsNotNull(xmlDocument.DocumentElement); Assert.AreEqual("strvalue", xmlDocument.DocumentElement.GetAttribute("strattr")); } }
public void XmlTest() { using (DbManager db = new DbManager()) { TestAccessor ta = TestAccessor.CreateInstance(); XmlReader xml = ta.GetXml(db, 2); xml.MoveToContent(); Assert.IsTrue(xml.ReadToDescendant("element")); Assert.AreEqual("strvalue", xml.GetAttribute("strattr")); } }
public void ReturnParameterTest() { using (DbManager db = new DbManager()) { TestAccessor ta = TestAccessor.CreateInstance(); int expectedValue = 12345; int actualValue = ta.Scalar_ReturnParameter(db); Assert.AreEqual(expectedValue, actualValue); } }
public void OutputParameter3Test() { using (DbManager db = new DbManager()) { TestAccessor ta = TestAccessor.CreateInstance(); string expectedValue = "54321"; string actualValue = ta.Scalar_OutputParameter3(db); Assert.AreEqual(expectedValue, actualValue); } }
public void DataReader2Test() { using (DbManager db = new DbManager()) { TestAccessor ta = TestAccessor.CreateInstance(); string expectedValue = "54321"; string actualValue = ta.Scalar_DataReader2(db); Assert.AreEqual(expectedValue, actualValue); } }
public void RefTest() { TestAccessor ta = (TestAccessor)DataAccessor.CreateInstance(typeof(TestAccessor)); RefEnum a; RefEnum b = RefEnum.E_B; ta.OutRefEnumTest("B", out a, ref b); Assert.AreEqual(RefEnum.E_B, a); Assert.AreEqual(RefEnum.E_BB, b); }
public void Test() { TestAccessor ta = DataAccessor.CreateInstance <TestAccessor>(); using (DbManager db = ta.GetDbManager()) using (IDataReader dr = ta.SelectAllIDataReaderSchemaOnly(db)) { DataTable table = dr.GetSchemaTable(); Assert.AreEqual("PersonID", table.Rows[0]["ColumnName"]); Assert.AreEqual(typeof(int), table.Rows[0]["DataType"]); } }
public void GenericsDictionaryMismatchKeyTypeCompoundValueTest() { TestAccessor da = DataAccessor.CreateInstance <TestAccessor>(); Dictionary <CompoundValue, PersonMultiPK> persons = da.SelectAllT9(); Assert.IsNotNull(persons); Assert.IsTrue(persons.Count > 0); PersonMultiPK actualValue = persons[new CompoundValue(1, "Pupkin")]; Assert.IsNotNull(actualValue); Assert.AreEqual("John", actualValue.FirstName); }
public void Test() { TestAccessor ta = (TestAccessor)DataAccessor.CreateInstance(typeof(TestAccessor)); TestObject o = ta.LoadById(2); Assert.IsNotNull(o); Assert.IsNotNull(o.Xml); List <TestObject> lst = ta.LoadAll(); Assert.IsNotEmpty(lst); Assert.IsNotNull(lst[0].Xml); }
public void GenericsDictionaryMismatchKeyTypeWithHierarchyTest() { TestAccessor da = DataAccessor.CreateInstance <TestAccessor>(); Dictionary <long, Derived> persons = da.SelectAllDerived(); Assert.IsNotNull(persons); Assert.IsTrue(persons.Count > 0); Person actualValue = persons[1]; Assert.IsNotNull(actualValue); Assert.AreEqual("John", actualValue.FirstName); }
public void GenericsScalarDictionaryByMapIndexTest() { TestAccessor da = DataAccessor.CreateInstance <TestAccessor>(); Dictionary <CompoundValue, string> persons = da.GenericsScalarDictionaryByMapIndex(); Assert.IsNotNull(persons); Assert.IsTrue(persons.Count > 0); string actualValue = persons[new CompoundValue(_id, "John")]; Assert.IsNotNull(actualValue); Assert.AreEqual("John", actualValue); }
public void GenericsScalarDictionaryByPKWithObjectTypeTest() { TestAccessor da = DataAccessor.CreateInstance <TestAccessor>(); Dictionary <int, object> persons = da.GenericsScalarDictionaryByPKWithObjectType(); Assert.IsNotNull(persons); Assert.IsTrue(persons.Count > 0); Person actualValue = (Person)persons[1]; Assert.IsNotNull(actualValue); Assert.AreEqual("John", actualValue.FirstName); }
public DictionaryTest() { _da = (TestAccessor)DataAccessor.CreateInstance(typeof(TestAccessor)); }