Ejemplo n.º 1
0
 public virtual void TestInitialize()
 {
     string connectionString = @"Provider=VFPOLEDB.1;Data Source=" + Path.GetFullPath("Northwind.dbc") + ";Exclusive=false";
     this.northwind = new LinqToVfp.Northwind.Tests.NorthwindEntityProvider.NorthwindDataContext(connectionString);
     //this.northwind.Provider.Log = new TestContextWriter(this.TestContext);
     this.northwind.Provider.AutoRightTrimStrings = true;
 }
Ejemplo n.º 2
0
        public void TestCustomersIncludeOrdersAndDetails()
        {
            NorthwindDataContext nw = new NorthwindDataContext(this.Northwind.Provider.New(new TestPolicy("Orders", "Details")));

            var custs = nw.Customers.Where(c => c.CustomerID == "ALFKI").ToList();
            Assert.AreEqual(1, custs.Count);
            Assert.AreNotEqual(null, custs[0].Orders);
            Assert.AreEqual(6, custs[0].Orders.Count);
            Assert.IsTrue(custs[0].Orders.Any(o => o.OrderID == 10643));
            Assert.AreNotEqual(null, custs[0].Orders.Single(o => o.OrderID == 10643).Details);
            Assert.AreEqual(3, custs[0].Orders.Single(o => o.OrderID == 10643).Details.Count);
        }
Ejemplo n.º 3
0
        public void TestCustomersIncludeOrders()
        {
            NorthwindDataContext nw = new NorthwindDataContext(this.Northwind.Provider.New(new TestPolicy("Orders")));

            var custs = nw.Customers.Where(c => c.CustomerID == "ALFKI").ToList();
            Assert.AreEqual(1, custs.Count);
            Assert.AreNotEqual(null, custs[0].Orders);
            Assert.AreEqual(6, custs[0].Orders.Count);
        }
Ejemplo n.º 4
0
        public void TestCustomersWhereIncludeOrdersAndDetails()
        {
            NorthwindDataContext nw = new NorthwindDataContext(this.Northwind.Provider.New(new TestPolicy("Orders", "Details")));

            TestQuery(
                from c in nw.Customers
                where c.City == "London"
                select c
                );
        }
Ejemplo n.º 5
0
        public void TestCustomersIncludeOrdersAndDetails()
        {
            NorthwindDataContext nw = new NorthwindDataContext(this.Northwind.Provider.New(new TestPolicy("Orders", "Details")));

            TestQuery(
                nw.Customers
                );
        }
Ejemplo n.º 6
0
        public void TestXmlMappingSelectCustomers()
        {
            var nw = new NorthwindDataContext(this.Northwind.Provider.New(VfpXmlMapping.FromXml(Properties.Resources.NorthwindXml)));

            TestQuery(
                from c in this.Northwind.Customers
                where c.City == "London"
                select c.ContactName
                );
        }