You've already forked linux-packaging-mono
Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
parent
1190d13a04
commit
6bdd276d05
@@ -71,7 +71,7 @@ using MsNorthwind;
|
||||
|
||||
|
||||
Assert.IsNotNull(dbCommand.CommandText);
|
||||
Assert.Greater(dbCommand.Parameters.Count, 0);
|
||||
AssertHelper.Greater(dbCommand.Parameters.Count, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ using nwind;
|
||||
Northwind db = CreateDB();
|
||||
Expression<Func<Customer, bool>> predicate = c => c.City == "Paris";
|
||||
int count = db.Customers.Count(predicate);
|
||||
Assert.Greater(count, 0); // Some databases have more than 1 customer in Paris
|
||||
AssertHelper.Greater(count, 0); // Some databases have more than 1 customer in Paris
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -68,7 +68,7 @@ using nwind;
|
||||
{
|
||||
Northwind db = CreateDB();
|
||||
int result = db.ExecuteCommand("SELECT count(*) FROM \"Products\"");
|
||||
Assert.Greater(result, 0, "Expecting some rows in Products table, got:" + result);
|
||||
AssertHelper.Greater(result, 0, "Expecting some rows in Products table, got:" + result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -85,7 +85,7 @@ using nwind;
|
||||
Northwind db = CreateDB();
|
||||
int result = db.ExecuteCommand("SELECT count(*) FROM [Products] WHERE [ProductID]>{0}", 3);
|
||||
//long iResult = base.ExecuteScalar(sql);
|
||||
Assert.Greater(result, 0, "Expecting some rows in Products table, got:" + result);
|
||||
AssertHelper.Greater(result, 0, "Expecting some rows in Products table, got:" + result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ using nwind;
|
||||
string beforecountry = character.Country;
|
||||
character.Country = "Burmuda";
|
||||
|
||||
Assert.Greater(db.GetChangeSet().Updates.Count, 0);
|
||||
AssertHelper.Greater(db.GetChangeSet().Updates.Count, 0);
|
||||
db.SubmitChanges();
|
||||
|
||||
var character2 = db.Customers.First(c=>c.CustomerID==character.CustomerID);
|
||||
|
||||
@@ -159,7 +159,7 @@ using nwind;
|
||||
|
||||
var q3 = q1.Union(q2);
|
||||
|
||||
Assert.Greater(q1.Count(), 0);
|
||||
AssertHelper.Greater(q1.Count(), 0);
|
||||
Assert.IsTrue(q1.Count() + q2.Count() >= q3.Count());
|
||||
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace nwind
|
||||
var q = from p in db.Products select p;
|
||||
List<Product> products = q.ToList();
|
||||
int productCount = products.Count;
|
||||
Assert.Greater(productCount, 0, "Expected some products, got none");
|
||||
AssertHelper.Greater(productCount, 0, "Expected some products, got none");
|
||||
}
|
||||
|
||||
#if !DEBUG && SQLITE
|
||||
@@ -443,7 +443,7 @@ namespace nwind
|
||||
select p;
|
||||
|
||||
int count = q.Count();
|
||||
Assert.Less(count, db.Customers.Count());
|
||||
AssertHelper.Less(count, db.Customers.Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -455,7 +455,7 @@ namespace nwind
|
||||
select p;
|
||||
|
||||
int count = q.Count();
|
||||
Assert.Less(count, db.Customers.Count());
|
||||
AssertHelper.Less(count, db.Customers.Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -496,7 +496,7 @@ namespace nwind
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(ExceptionType=typeof(InvalidOperationException), ExpectedMessage="Data context options cannot be modified after results have been returned from a query.")]
|
||||
[ExpectedException(typeof(InvalidOperationException), ExpectedMessage="Data context options cannot be modified after results have been returned from a query.")]
|
||||
public void C13_Changing_ObjectTrackingEnabled2False()
|
||||
{
|
||||
Northwind db = CreateDB();
|
||||
@@ -507,7 +507,7 @@ namespace nwind
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(ExceptionType = typeof(InvalidOperationException), ExpectedMessage = "Data context options cannot be modified after results have been returned from a query.")]
|
||||
[ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Data context options cannot be modified after results have been returned from a query.")]
|
||||
public void C14_Changing_DeferredLoadingEnabled2False()
|
||||
{
|
||||
Northwind db = CreateDB();
|
||||
@@ -518,7 +518,7 @@ namespace nwind
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(ExceptionType = typeof(InvalidOperationException), ExpectedMessage = "Object tracking is not enabled for the current data context instance.")]
|
||||
[ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Object tracking is not enabled for the current data context instance.")]
|
||||
public void C15_SubmitChanges_DeferredLoadingEnabled_False()
|
||||
{
|
||||
Northwind db = CreateDB();
|
||||
@@ -572,7 +572,7 @@ namespace nwind
|
||||
.Join(db.GetTable<EmployeeTerritory>(), t => t.TerritoryID, l => l.TerritoryID, (t, l) => l)
|
||||
.Join(db.GetTable<Employee>().Where(e => e.EmployeeID > 0), l => l.EmployeeID, e => e.EmployeeID, (l, e) => e);
|
||||
var employeeCount = q.Count();
|
||||
Assert.Greater(employeeCount, 0, "Expected any employees, got count=" + employeeCount);
|
||||
AssertHelper.Greater(employeeCount, 0, "Expected any employees, got count=" + employeeCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -839,7 +839,7 @@ namespace nwind
|
||||
|
||||
var q = from p in db.Products where p.ProductName == "Chai" select p.ProductID;
|
||||
var productID = q.First();
|
||||
Assert.Greater(productID, 0, "Expected penID>0, got " + productID);
|
||||
AssertHelper.Greater(productID, 0, "Expected penID>0, got " + productID);
|
||||
}
|
||||
|
||||
|
||||
@@ -880,7 +880,7 @@ namespace nwind
|
||||
|
||||
var q = from p in db.Products where p.ProductName == "Chai" select p.ProductID;
|
||||
var productID = q.Last();
|
||||
Assert.Greater(productID, 0, "Expected penID>0, got " + productID);
|
||||
AssertHelper.Greater(productID, 0, "Expected penID>0, got " + productID);
|
||||
}
|
||||
|
||||
#if !DEBUG && (POSTGRES || (MSSQL && !L2SQL))
|
||||
@@ -902,11 +902,11 @@ namespace nwind
|
||||
{
|
||||
//int compareNames = prevProductName.CompareTo(p.ProductName);
|
||||
int compareNames = string.Compare(prevProductName, p.ProductName, stringComparisonType);
|
||||
Assert.Less(compareNames, 0, "When ordering by names, expected " + prevProductName + " to come after " + p.ProductName);
|
||||
AssertHelper.Less(compareNames, 0, "When ordering by names, expected " + prevProductName + " to come after " + p.ProductName);
|
||||
}
|
||||
prevProductName = p.ProductName;
|
||||
}
|
||||
//Assert.Greater(productID,0,"Expected penID>0, got "+productID);
|
||||
//AssertHelper.Greater(productID,0,"Expected penID>0, got "+productID);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -915,7 +915,7 @@ namespace nwind
|
||||
Northwind db = CreateDB();
|
||||
//var q = from p in db.Products where "Chai"==p.ProductName select p.Order;
|
||||
//List<Order> penOrders = q.ToList();
|
||||
//Assert.Greater(penOrders.Count,0,"Expected some orders for product 'Chai'");
|
||||
//AssertHelper.Greater(penOrders.Count,0,"Expected some orders for product 'Chai'");
|
||||
|
||||
var q =
|
||||
from o in db.Orders
|
||||
@@ -929,7 +929,7 @@ namespace nwind
|
||||
Assert.IsNotNull(co.c.City, "Expected non-null customer city");
|
||||
Assert.IsNotNull(co.o, "Expected non-null order");
|
||||
}
|
||||
Assert.Greater(list1.Count, 0, "Expected some orders for London customers");
|
||||
AssertHelper.Greater(list1.Count, 0, "Expected some orders for London customers");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -947,7 +947,7 @@ namespace nwind
|
||||
Assert.IsNotNull(co.c, "Expected non-null customer");
|
||||
Assert.IsNotNull(co.o, "Expected non-null order");
|
||||
}
|
||||
Assert.Greater(list1.Count, 0, "Expected some orders for London customers");
|
||||
AssertHelper.Greater(list1.Count, 0, "Expected some orders for London customers");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -962,7 +962,7 @@ namespace nwind
|
||||
where c.City == "London"
|
||||
select new { c, o };
|
||||
|
||||
Assert.Greater(q.ToList().Count, 0, "Expected some orders for London customers");
|
||||
AssertHelper.Greater(q.ToList().Count, 0, "Expected some orders for London customers");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -987,7 +987,7 @@ namespace nwind
|
||||
#else
|
||||
int expectedCount = 2; //Oracle, Mysql: 'Toilet Paper' and 'iPod'
|
||||
#endif
|
||||
Assert.Greater(prods.Count, expectedCount, "Expected couple of products with letter 'p'");
|
||||
AssertHelper.Greater(prods.Count, expectedCount, "Expected couple of products with letter 'p'");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -1002,11 +1002,11 @@ namespace nwind
|
||||
).Take(5);
|
||||
//var q = db.Products.Where( p=>p.ProductName.Contains("p")).Take(5);
|
||||
List<Product> prods = q.ToList();
|
||||
Assert.Greater(prods.Count, 2, "Expected couple of products with letter 'p'");
|
||||
AssertHelper.Greater(prods.Count, 2, "Expected couple of products with letter 'p'");
|
||||
|
||||
var prodID0 = prods[0].ProductID;
|
||||
var prodID1 = prods[1].ProductID;
|
||||
Assert.Greater(prodID0, prodID1, "Sorting is broken");
|
||||
AssertHelper.Greater(prodID0, prodID1, "Sorting is broken");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -136,7 +136,7 @@ using Id = System.Int32;
|
||||
{
|
||||
var q = from p in db.Products select p;
|
||||
int productCount = q.Count();
|
||||
Assert.Greater(productCount, 0, "Expected non-zero product count");
|
||||
AssertHelper.Greater(productCount, 0, "Expected non-zero product count");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -144,7 +144,7 @@ using Id = System.Int32;
|
||||
{
|
||||
var q = from p in db.Products select p.ProductID;
|
||||
int productCount = q.Count();
|
||||
Assert.Greater(productCount, 0, "Expected non-zero product count");
|
||||
AssertHelper.Greater(productCount, 0, "Expected non-zero product count");
|
||||
Console.WriteLine();
|
||||
}
|
||||
[Test]
|
||||
@@ -152,7 +152,7 @@ using Id = System.Int32;
|
||||
{
|
||||
var q = from p in db.Products select p.ProductID;
|
||||
int productCount = q.Count(i => i < 3);
|
||||
Assert.Greater(productCount, 0, "Expected non-zero product count");
|
||||
AssertHelper.Greater(productCount, 0, "Expected non-zero product count");
|
||||
Assert.IsTrue(productCount < 4, "Expected product count < 3");
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ using Id = System.Int32;
|
||||
{
|
||||
var q = from p in db.Products select p.ProductID;
|
||||
var maxID = q.Max();
|
||||
Assert.Greater(maxID, 0, "Expected non-zero product count");
|
||||
AssertHelper.Greater(maxID, 0, "Expected non-zero product count");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -169,7 +169,7 @@ using Id = System.Int32;
|
||||
{
|
||||
var q = from p in db.Products select p.ProductID;
|
||||
var minID = q.Min();
|
||||
Assert.Greater(minID, 0, "Expected non-zero product count");
|
||||
AssertHelper.Greater(minID, 0, "Expected non-zero product count");
|
||||
}
|
||||
|
||||
#if !ORACLE // picrap: this test causes an internal buffer overflow when marshaling with oracle win32 driver
|
||||
@@ -179,7 +179,7 @@ using Id = System.Int32;
|
||||
{
|
||||
var q = from p in db.Products select p.ProductID;
|
||||
double avg = q.Average();
|
||||
Assert.Greater(avg, 0, "Expected non-zero productID average");
|
||||
AssertHelper.Greater(avg, 0, "Expected non-zero productID average");
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -268,7 +268,7 @@ using Id = System.Int32;
|
||||
var q4 = from p in db.Products select p.ProductName + p.ProductID;
|
||||
//var q4 = from p in db.Products select p.ProductID;
|
||||
var q5 = q4.ToList();
|
||||
Assert.Greater(q5.Count, 2, "Expected to see some concat strings");
|
||||
AssertHelper.Greater(q5.Count, 2, "Expected to see some concat strings");
|
||||
foreach (string s0 in q5)
|
||||
{
|
||||
bool startWithLetter = Char.IsLetter(s0[0]);
|
||||
@@ -288,7 +288,7 @@ using Id = System.Int32;
|
||||
select p.ProductName+p.ProductID;
|
||||
//var q4 = from p in db.Products select p.ProductID;
|
||||
//var q5 = q4.ToList();
|
||||
Assert.Greater( q4.Count(), 2, "Expected to see some concat strings");
|
||||
AssertHelper.Greater( q4.Count(), 2, "Expected to see some concat strings");
|
||||
foreach(string s0 in q4)
|
||||
{
|
||||
bool startWithLetter = Char.IsLetter(s0[0]);
|
||||
@@ -312,8 +312,8 @@ using Id = System.Int32;
|
||||
CustomerID = c.CustomerID
|
||||
});
|
||||
var list = q.ToList();
|
||||
Assert.Greater(list.Count(), 0, "Expected list");
|
||||
//Assert.Greater(list.Count(), 0, "Expected list");
|
||||
AssertHelper.Greater(list.Count(), 0, "Expected list");
|
||||
//AssertHelper.Greater(list.Count(), 0, "Expected list");
|
||||
Assert.Ignore("test passed but: theoretically constructions of entity types are not allowed");
|
||||
}
|
||||
|
||||
@@ -331,8 +331,8 @@ using Id = System.Int32;
|
||||
//this OrderBy clause messes up the SQL statement
|
||||
var q2 = q.OrderBy(c => c.CustomerID);
|
||||
var list = q2.ToList();
|
||||
Assert.Greater(list.Count(), 0, "Expected list");
|
||||
//Assert.Greater(list.Count(), 0, "Expected list");
|
||||
AssertHelper.Greater(list.Count(), 0, "Expected list");
|
||||
//AssertHelper.Greater(list.Count(), 0, "Expected list");
|
||||
}
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ using Id = System.Int32;
|
||||
orderby c.ContactName ?? ""
|
||||
select c;
|
||||
var list = q.ToList();
|
||||
Assert.Greater(list.Count(), 0, "Expected list");
|
||||
AssertHelper.Greater(list.Count(), 0, "Expected list");
|
||||
}
|
||||
|
||||
[Test(Description = "Non-dynamic version of DL5_NestedObjectSelect")]
|
||||
|
||||
@@ -231,10 +231,10 @@ using nwind;
|
||||
select new { g.Key, OrderCount = g.Count() };
|
||||
|
||||
var lst = q2.ToList();
|
||||
Assert.Greater(lst.Count, 0, "Expected some grouped order results");
|
||||
AssertHelper.Greater(lst.Count, 0, "Expected some grouped order results");
|
||||
var result0 = lst[0];
|
||||
Assert.IsTrue(result0.Key != null, "Key must be non-null");
|
||||
Assert.Greater(result0.OrderCount, 0, "Count must be > 0");
|
||||
AssertHelper.Greater(result0.OrderCount, 0, "Count must be > 0");
|
||||
//select new { g.Key , SumPerCustomer = g.Sum(o2=>o2.OrderID) };
|
||||
}
|
||||
|
||||
@@ -252,10 +252,10 @@ using nwind;
|
||||
select new { g.Key, OrderCount = g.Count() };
|
||||
|
||||
var lst = q2.ToList();
|
||||
Assert.Greater(lst.Count, 0, "Expected some grouped order results");
|
||||
AssertHelper.Greater(lst.Count, 0, "Expected some grouped order results");
|
||||
var result0 = lst[0];
|
||||
Assert.IsTrue(result0.Key != null, "Key must be non-null");
|
||||
Assert.Greater(result0.OrderCount, 0, "Count must be > 0");
|
||||
AssertHelper.Greater(result0.OrderCount, 0, "Count must be > 0");
|
||||
//select new { g.Key , SumPerCustomer = g.Sum(o2=>o2.OrderID) };
|
||||
}
|
||||
|
||||
@@ -272,12 +272,12 @@ using nwind;
|
||||
//where g.Count()>1
|
||||
select new { g.Key, OrderSum = g.Sum(o => o.OrderID) };
|
||||
var lst = q2.ToList();
|
||||
Assert.Greater(lst.Count, 0, "Expected some grouped order results");
|
||||
AssertHelper.Greater(lst.Count, 0, "Expected some grouped order results");
|
||||
foreach (var result in lst)
|
||||
{
|
||||
Console.WriteLine(" Result: custID=" + result.Key + " sum=" + result.OrderSum);
|
||||
Assert.IsTrue(result.Key != null, "Key must be non-null");
|
||||
Assert.Greater(result.OrderSum, 0, "OrderSum must be > 0");
|
||||
AssertHelper.Greater(result.OrderSum, 0, "OrderSum must be > 0");
|
||||
}
|
||||
//select new { g.Key , SumPerCustomer = g.Sum(o2=>o2.OrderID) };
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ using nwind;
|
||||
decimal[] d = new decimal[] { 1, 4, 5, 6, 10248, 10255 };
|
||||
var q = db.OrderDetails.Where(o => d.Contains(o.OrderID));
|
||||
|
||||
Assert.Greater(q.Count(), 0);
|
||||
AssertHelper.Greater(q.Count(), 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ using DbLinq.Data.Linq;
|
||||
|
||||
|
||||
var list = query.ToList();
|
||||
Assert.Greater(list.Count, 0);
|
||||
AssertHelper.Greater(list.Count, 0);
|
||||
}
|
||||
|
||||
#if !DEBUG && SQLITE
|
||||
@@ -299,7 +299,7 @@ using DbLinq.Data.Linq;
|
||||
|
||||
|
||||
var list = query.ToList();
|
||||
Assert.Greater(list.Count, 0);
|
||||
AssertHelper.Greater(list.Count, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ using DbLinq.Data.Linq;
|
||||
|
||||
|
||||
var list = query.ToList();
|
||||
Assert.Greater(list.Count, 0);
|
||||
AssertHelper.Greater(list.Count, 0);
|
||||
}
|
||||
|
||||
#if !DEBUG && (SQLITE || MSSQL)
|
||||
@@ -354,7 +354,7 @@ using DbLinq.Data.Linq;
|
||||
|
||||
|
||||
var list = query.ToList();
|
||||
Assert.Greater(list.Count, 0);
|
||||
AssertHelper.Greater(list.Count, 0);
|
||||
}
|
||||
|
||||
#if !DEBUG && SQLITE
|
||||
@@ -388,7 +388,7 @@ using DbLinq.Data.Linq;
|
||||
|
||||
|
||||
var list = query.ToList();
|
||||
Assert.Greater(list.Count, 0);
|
||||
AssertHelper.Greater(list.Count, 0);
|
||||
}
|
||||
|
||||
#if !DEBUG && SQLITE
|
||||
@@ -410,7 +410,7 @@ using DbLinq.Data.Linq;
|
||||
|
||||
var list = query.ToList();
|
||||
|
||||
Assert.Greater(list.Count, 0);
|
||||
AssertHelper.Greater(list.Count, 0);
|
||||
}
|
||||
|
||||
#if !DEBUG && POSTGRES
|
||||
@@ -443,7 +443,7 @@ using DbLinq.Data.Linq;
|
||||
|
||||
var list = query.ToList();
|
||||
|
||||
Assert.Greater(list.Count, 0);
|
||||
AssertHelper.Greater(list.Count, 0);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -481,7 +481,7 @@ using DbLinq.Data.Linq;
|
||||
|
||||
var list = query.ToList();
|
||||
|
||||
Assert.Greater(list.Count, 0);
|
||||
AssertHelper.Greater(list.Count, 0);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ using nwind;
|
||||
{
|
||||
var db = CreateDB();
|
||||
var customer = db.Customers.First();
|
||||
Assert.Greater(customer.Orders.Count, 0);
|
||||
AssertHelper.Greater(customer.Orders.Count, 0);
|
||||
}
|
||||
|
||||
#if !DEBUG && (SQLITE || (MSSQL && !L2SQL))
|
||||
@@ -65,7 +65,7 @@ using nwind;
|
||||
var db = CreateDB();
|
||||
var results = (from c in db.Customers select c.Orders).ToList();
|
||||
|
||||
Assert.Greater(results.Count, 0);
|
||||
AssertHelper.Greater(results.Count, 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -98,7 +98,7 @@ using nwind;
|
||||
var db = CreateDB();
|
||||
var customer = db.Customers.First();
|
||||
|
||||
Assert.Greater(customer.Orders.Count, 0, "#1");
|
||||
AssertHelper.Greater(customer.Orders.Count, 0, "#1");
|
||||
Assert.IsTrue(customer.Orders.HasLoadedOrAssignedValues, "#2");
|
||||
customer.Orders.SetSource(System.Linq.Enumerable.Empty<Order>());
|
||||
}
|
||||
@@ -136,7 +136,7 @@ using nwind;
|
||||
int ordersCount = (from cust in db.Customers
|
||||
select cust.Orders.Count).First();
|
||||
|
||||
Assert.Greater(ordersCount, 0);
|
||||
AssertHelper.Greater(ordersCount, 0);
|
||||
|
||||
var customer2 = db.Customers.First();
|
||||
customer2.Orders.SetSource(System.Linq.Enumerable.Empty<Order>());
|
||||
@@ -154,11 +154,11 @@ using nwind;
|
||||
var c = db.Customers.First();
|
||||
|
||||
int beforeCount = c.Orders.Count;
|
||||
Assert.Greater(beforeCount, 0);
|
||||
AssertHelper.Greater(beforeCount, 0);
|
||||
c.Orders.Clear();
|
||||
Assert.AreEqual(c.Orders.Count, 0);
|
||||
c.Orders.AddRange(db.Orders);
|
||||
Assert.Greater(c.Orders.Count, beforeCount);
|
||||
AssertHelper.Greater(c.Orders.Count, beforeCount);
|
||||
db.Refresh(RefreshMode.OverwriteCurrentValues, c.Orders);
|
||||
|
||||
Assert.AreEqual(c.Orders.Count, beforeCount);
|
||||
@@ -174,13 +174,13 @@ using nwind;
|
||||
var c = db.Customers.First();
|
||||
|
||||
int beforeCount = c.Orders.Count;
|
||||
Assert.Greater(beforeCount, 0);
|
||||
AssertHelper.Greater(beforeCount, 0);
|
||||
c.Orders.Clear();
|
||||
Assert.AreEqual(c.Orders.Count, 0);
|
||||
c.Orders.AddRange(db.Orders);
|
||||
|
||||
int middleCount = c.Orders.Count;
|
||||
Assert.Greater(c.Orders.Count, beforeCount);
|
||||
AssertHelper.Greater(c.Orders.Count, beforeCount);
|
||||
|
||||
db.Refresh(RefreshMode.KeepCurrentValues, c.Orders);
|
||||
Assert.AreEqual(c.Orders.Count, middleCount);
|
||||
@@ -233,7 +233,7 @@ using nwind;
|
||||
{
|
||||
var db = CreateDB();
|
||||
var customer = db.Customers.Where(c => c.Orders.Count > 0).First();
|
||||
Assert.Greater(customer.Orders.Count, 0);
|
||||
AssertHelper.Greater(customer.Orders.Count, 0);
|
||||
bool ok;
|
||||
System.ComponentModel.ListChangedEventArgs args = null;
|
||||
customer.Orders.ListChanged += delegate(object sender, System.ComponentModel.ListChangedEventArgs a)
|
||||
|
||||
@@ -86,10 +86,10 @@ using nwind;
|
||||
foreach (var c in q)
|
||||
{
|
||||
Assert.IsNotNull(c.CustomerID);
|
||||
Assert.Greater(c.OrderCount, -1);
|
||||
AssertHelper.Greater(c.OrderCount, -1);
|
||||
count++;
|
||||
}
|
||||
Assert.Greater(count, 0);
|
||||
AssertHelper.Greater(count, 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -103,10 +103,10 @@ using nwind;
|
||||
foreach (var v in q)
|
||||
{
|
||||
Assert.IsNotNull(v.c.CustomerID);
|
||||
Assert.Greater(v.OrderCount, -1);
|
||||
AssertHelper.Greater(v.OrderCount, -1);
|
||||
count++;
|
||||
}
|
||||
Assert.Greater(count, 0);
|
||||
AssertHelper.Greater(count, 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -121,7 +121,7 @@ using nwind;
|
||||
Assert.IsTrue(c.CustomerID!=null, "Non-null customerID required");
|
||||
count++;
|
||||
}
|
||||
Assert.Greater(count, 0);
|
||||
AssertHelper.Greater(count, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ using nwind;
|
||||
var customer = new Customer();
|
||||
db.Customers.Attach(customer, originalCustomer);
|
||||
|
||||
Assert.Greater(db.Customers.GetModifiedMembers(customer).Count(), 0);
|
||||
AssertHelper.Greater(db.Customers.GetModifiedMembers(customer).Count(), 0);
|
||||
}
|
||||
|
||||
#if !DEBUG && (SQLITE || POSTGRES || (MSSQL && !L2SQL))
|
||||
|
||||
@@ -33,7 +33,7 @@ using NUnit.Framework;
|
||||
|
||||
using nwind;
|
||||
|
||||
#if MONO_STRICT && !MONO
|
||||
#if MONO_STRICT
|
||||
using System.Diagnostics;
|
||||
public static class Profiler
|
||||
{
|
||||
|
||||
@@ -165,7 +165,7 @@ using Id = System.Int32;
|
||||
newProd.QuantityPerUnit = "33 1/2";
|
||||
db.Products.InsertOnSubmit(newProd);
|
||||
db.SubmitChanges();
|
||||
Assert.Greater(newProd.ProductID, 0, "After insertion, ProductID should be non-zero");
|
||||
AssertHelper.Greater(newProd.ProductID, 0, "After insertion, ProductID should be non-zero");
|
||||
//Assert.IsFalse(newProd.IsModified, "After insertion, Product.IsModified should be false");
|
||||
return (int)newProd.ProductID; //this test cab be used from delete tests
|
||||
}
|
||||
@@ -180,7 +180,7 @@ using Id = System.Int32;
|
||||
public void G2_DeleteTest()
|
||||
{
|
||||
int insertedID = insertProduct_priv();
|
||||
Assert.Greater(insertedID, 0, "DeleteTest cannot operate if row was not inserted");
|
||||
AssertHelper.Greater(insertedID, 0, "DeleteTest cannot operate if row was not inserted");
|
||||
|
||||
Northwind db = CreateDB();
|
||||
|
||||
@@ -200,7 +200,7 @@ using Id = System.Int32;
|
||||
public void G3_DeleteTest()
|
||||
{
|
||||
int insertedID = insertProduct_priv();
|
||||
Assert.Greater(insertedID, 0, "DeleteTest cannot operate if row was not inserted");
|
||||
AssertHelper.Greater(insertedID, 0, "DeleteTest cannot operate if row was not inserted");
|
||||
|
||||
Northwind db = CreateDB();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user