public void TestGroupByNull() { IList list = dataMapper.QueryForList("GetAllProductCategoriesJIRA250", null); Domain.Petshop.Category cat = (Domain.Petshop.Category)list[0]; Assert.AreEqual(0, cat.Products.Count); }
public void TestForQueryForObjectGeneric() { Domain.Petshop.Category cat = dataMapper.QueryForObject <Domain.Petshop.Category>("GetFishGeneric", null); Assert.IsNotNull(cat); Assert.AreEqual("FISH", cat.Id); Assert.AreEqual("Fish", cat.Name); Assert.IsNotNull(cat.GenericProducts, "Expected product list."); Assert.AreEqual(4, cat.GenericProducts.Count); Domain.Petshop.Product product = cat.GenericProducts[0]; Assert.AreEqual(2, product.GenericItems.Count); }
public void TestNestedProperties() { IList list = dataMapper.QueryForList("GetFish", null); Assert.AreEqual(1, list.Count); Domain.Petshop.Category cat = (Domain.Petshop.Category)list[0]; Assert.AreEqual("FISH", cat.Id); Assert.AreEqual("Fish", cat.Name); Assert.IsNotNull(cat.Products, "Expected product list."); Assert.AreEqual(4, cat.Products.Count); Domain.Petshop.Product product = (Domain.Petshop.Product)cat.Products[0]; Assert.AreEqual(2, product.Items.Count); }