public void sample_test_xml_data_file_with_elements() { UnitTestHelpers.ReadData("SampleUnitTests.TestData.StoreListData.xml"); using (var db = MSSQLSessionFactory.OpenSession()) { var query = (from s in db.Store select s).ToList(); Assert.AreEqual(2, query.Count); } }
public void sample_test_xml_data_file_with_attributes() { UnitTestHelpers.ReadData("SampleUnitTests.TestData.StoreListDataWithAttributes.xml"); using (var db = MSSQLSessionFactory.OpenSession()) { var query = (from s in db.Store select s).ToList(); Assert.AreEqual(5, query.Count); var productQuery = (from s in db.Product select s).ToList(); Assert.AreEqual(4, productQuery.Count); } }
public void sample_test_identity_override() { UnitTestHelpers.ReadData("SampleUnitTests.TestData.StoreListData.xml"); using (var db = MSSQLSessionFactory.OpenSession()) { var productTypeList = (from s in db.ProductType orderby s.Id select s.Id).ToList(); Assert.AreEqual(1, productTypeList[0]); Assert.AreEqual(5, productTypeList[1]); Assert.AreEqual(6, productTypeList[2]); } }
public void sample_test_json_data_file() { UnitTestHelpers.ReadData("SampleUnitTests.TestData.StoreListData.json"); using (var db = MSSQLSessionFactory.OpenSession()) { var storeList = (from s in db.Store select s).ToList(); Assert.AreEqual(2, storeList.Count); var productTypeList = (from s in db.ProductType select s).ToList(); Assert.AreEqual(3, productTypeList.Count); var productList = (from s in db.Product select s).ToList(); Assert.AreEqual(2, productList.Count); } }