From: Marcos Henrich Date: Mon, 1 Aug 2016 09:27:37 +0000 (+0100) Subject: [bcl] Add NUnitHelper.cs with API not in nunit-lite X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=863dc73d1984175cb52734e1cb755c9d57de53bd;p=mono.git [bcl] Add NUnitHelper.cs with API not in nunit-lite NUnitHelper.cs adds CollectionAssert, FileAssert, StringAssert. Also adds AssertHelper class with methods that are not part of nunitlite Assert class. --- diff --git a/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources b/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources index 7b65749c86a..28c4af1277a 100644 --- a/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources +++ b/mcs/class/Microsoft.Build/Microsoft.Build_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs FunctionalTest.cs Microsoft.Build.Construction/ProjectItemElementTest.cs Microsoft.Build.Construction/ProjectRootElementTest.cs diff --git a/mcs/class/Mono.CodeContracts/Mono.CodeContracts_test.dll.sources b/mcs/class/Mono.CodeContracts/Mono.CodeContracts_test.dll.sources index 984809180a1..9e77c38bdf1 100644 --- a/mcs/class/Mono.CodeContracts/Mono.CodeContracts_test.dll.sources +++ b/mcs/class/Mono.CodeContracts/Mono.CodeContracts_test.dll.sources @@ -1,2 +1,3 @@ +../../test-helpers/NunitHelpers.cs RewriteAndLoad.cs TestCCRewrite.cs diff --git a/mcs/class/Mono.Parallel/Mono.Parallel_test.dll.sources b/mcs/class/Mono.Parallel/Mono.Parallel_test.dll.sources index 1eb8276dbde..c187abfe371 100644 --- a/mcs/class/Mono.Parallel/Mono.Parallel_test.dll.sources +++ b/mcs/class/Mono.Parallel/Mono.Parallel_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs Mono.Collections.Concurrent/CollectionStressTestHelper.cs Mono.Collections.Concurrent/ConcurrentSkipListTests.cs Mono.Threading/ParallelTestHelper.cs diff --git a/mcs/class/Mono.Posix/Mono.Posix_test.dll.sources b/mcs/class/Mono.Posix/Mono.Posix_test.dll.sources index a2f290f8656..55773333f78 100644 --- a/mcs/class/Mono.Posix/Mono.Posix_test.dll.sources +++ b/mcs/class/Mono.Posix/Mono.Posix_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs Mono.Unix/ReadlinkTest.cs Mono.Unix/StdioFileStreamTest.cs Mono.Unix/UnixEncodingTest.cs diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix.Native/RealTimeSignumTests.cs b/mcs/class/Mono.Posix/Test/Mono.Unix.Native/RealTimeSignumTests.cs index f68fe53b8ce..4a8f26ae17d 100644 --- a/mcs/class/Mono.Posix/Test/Mono.Unix.Native/RealTimeSignumTests.cs +++ b/mcs/class/Mono.Posix/Test/Mono.Unix.Native/RealTimeSignumTests.cs @@ -8,9 +8,7 @@ // using NUnit.Framework; -#if !MONODROID -using NUnit.Framework.SyntaxHelpers; -#endif + using System; using System.Text; using System.Threading; diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs b/mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs index 608127b568c..c968f5e7657 100644 --- a/mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs +++ b/mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs @@ -173,7 +173,7 @@ namespace MonoTests.Mono.Unix long r = Syscall.readlink (link, buf); if (r < 0) UnixMarshal.ThrowExceptionForLastError (); - Assert.GreaterOrEqual (buf.Length, r); + AssertHelper.GreaterOrEqual (buf.Length, r); if (r == buf.Length) buf = new byte[checked (buf.Length * 2)]; else @@ -199,7 +199,7 @@ namespace MonoTests.Mono.Unix long r = Syscall.readlinkat (TempFD, "link", buf); if (r < 0) UnixMarshal.ThrowExceptionForLastError (); - Assert.GreaterOrEqual (buf.Length, r); + AssertHelper.GreaterOrEqual (buf.Length, r); if (r == buf.Length) buf = new byte[checked (buf.Length * 2)]; else @@ -226,7 +226,7 @@ namespace MonoTests.Mono.Unix if (r < 0) UnixMarshal.ThrowExceptionForLastError (); Assert.AreEqual (r, sb.Length); - Assert.GreaterOrEqual (sb.Capacity, r); + AssertHelper.GreaterOrEqual (sb.Capacity, r); if (r == sb.Capacity) checked { sb.Capacity *= 2; } else @@ -255,7 +255,7 @@ namespace MonoTests.Mono.Unix if (r < 0) UnixMarshal.ThrowExceptionForLastError (); Assert.AreEqual (r, sb.Length); - Assert.GreaterOrEqual (sb.Capacity, r); + AssertHelper.GreaterOrEqual (sb.Capacity, r); if (r == sb.Capacity) checked { sb.Capacity *= 2; } else diff --git a/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs b/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs index 9abc27094c9..2b7ef95dae3 100644 --- a/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs +++ b/mcs/class/Mono.Posix/Test/Mono.Unix/UnixSignalTest.cs @@ -8,18 +8,14 @@ // using NUnit.Framework; -#if !MONODROID -using NUnit.Framework.SyntaxHelpers; -#endif + using System; using System.Text; using System.Threading; using Mono.Unix; using Mono.Unix.Android; using Mono.Unix.Native; -#if !MONODROID -namespace NUnit.Framework.SyntaxHelpers { class Dummy {} } -#endif + namespace MonoTests.Mono.Unix { [TestFixture] diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks_test.dll.sources b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks_test.dll.sources index 0dbb1260ba9..902f1ac1629 100644 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks_test.dll.sources +++ b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks_test.dll.sources @@ -1 +1,2 @@ +../../test-helpers/NunitHelpers.cs Mono.XBuild.Tasks/PcFileCacheTest.cs diff --git a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationSaveTest.cs b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationSaveTest.cs index 4d0e369b414..2bb7723f7a0 100644 --- a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationSaveTest.cs +++ b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationSaveTest.cs @@ -37,7 +37,6 @@ using SysConfig = System.Configuration.Configuration; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; namespace MonoTests.System.Configuration { using Util; diff --git a/mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs b/mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs index a9389f9b497..ceef4c02157 100644 --- a/mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs +++ b/mcs/class/System.Core/Test/System.Linq/EnumerableFixture.cs @@ -34,12 +34,9 @@ using System.Text; using System.Threading; using NUnit.Framework; using System.Linq; -using NUnit.Framework.SyntaxHelpers; using NUnit.Framework.Constraints; using System.Diagnostics; -namespace NUnit.Framework.SyntaxHelpers { class Dummy {} } - namespace MonoTests.System.Linq { [TestFixture] diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DataContext.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DataContext.cs index c9bea8ea40c..f2b6d3ede66 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DataContext.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DataContext.cs @@ -71,7 +71,7 @@ using MsNorthwind; Assert.IsNotNull(dbCommand.CommandText); - Assert.Greater(dbCommand.Parameters.Count, 0); + AssertHelper.Greater(dbCommand.Parameters.Count, 0); } } } diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DynamicLinqTest.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DynamicLinqTest.cs index 5ea0dbc7d76..9bd6aac50f9 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DynamicLinqTest.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/DynamicLinqTest.cs @@ -186,7 +186,7 @@ using nwind; Northwind db = CreateDB(); Expression> 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 } /// diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteCommand_Test.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteCommand_Test.cs index 87bf3d8cdee..b8a1c728d8e 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteCommand_Test.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteCommand_Test.cs @@ -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); } /// @@ -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); } } diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteQuery_Test.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteQuery_Test.cs index ea375055d7e..fac3d615da5 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteQuery_Test.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ExecuteQuery_Test.cs @@ -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); diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Linq_101_Samples/Advanced.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Linq_101_Samples/Advanced.cs index e420e84f6bb..dd976666e05 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Linq_101_Samples/Advanced.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Linq_101_Samples/Advanced.cs @@ -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()); } diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs index 1f443c32ac6..71762345002 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest.cs @@ -234,7 +234,7 @@ namespace nwind var q = from p in db.Products select p; List 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 @@ -572,7 +572,7 @@ namespace nwind .Join(db.GetTable(), t => t.TerritoryID, l => l.TerritoryID, (t, l) => l) .Join(db.GetTable().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); } /// @@ -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)) @@ -906,7 +906,7 @@ namespace nwind } 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 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 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] diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_Complex.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_Complex.cs index 8d8c325cbec..fe7a6753181 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_Complex.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_Complex.cs @@ -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")] diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_GroupBy.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_GroupBy.cs index 4d87952ed79..9ff4496ee8b 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_GroupBy.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTest_GroupBy.cs @@ -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) }; } diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_AnyCountFirst.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_AnyCountFirst.cs index 0c58ea44d4c..48e0020e30f 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_AnyCountFirst.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_AnyCountFirst.cs @@ -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); } diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_DateTimeFunctions.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_DateTimeFunctions.cs index 3d1981a405d..dabe2f12a78 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_DateTimeFunctions.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_DateTimeFunctions.cs @@ -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 { diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_EntitySet.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_EntitySet.cs index 40503fed4f5..16a0b0a7ba0 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_EntitySet.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/ReadTests_EntitySet.cs @@ -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()); } @@ -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()); @@ -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) diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/StoredProcTest.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/StoredProcTest.cs index f792f8e585f..e32291198ab 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/StoredProcTest.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/StoredProcTest.cs @@ -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 } diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Table.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Table.cs index 3aa1c9e1b6f..08ed664f1b3 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Table.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/Table.cs @@ -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)) diff --git a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/WriteTest.cs b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/WriteTest.cs index a30b2cff6a4..11fe0098a2a 100644 --- a/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/WriteTest.cs +++ b/mcs/class/System.Data.Linq/src/DbLinq/Test/Providers/WriteTest.cs @@ -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(); diff --git a/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs b/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs index 2fbdeb16c8a..1357f253347 100644 --- a/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs +++ b/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs @@ -34,9 +34,6 @@ using NUnit.Framework; using System; using System.Data; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Data { diff --git a/mcs/class/System.Data/Test/System.Data/ConstraintTest.cs b/mcs/class/System.Data/Test/System.Data/ConstraintTest.cs index 2875dc0a109..37a12abcffd 100644 --- a/mcs/class/System.Data/Test/System.Data/ConstraintTest.cs +++ b/mcs/class/System.Data/Test/System.Data/ConstraintTest.cs @@ -34,9 +34,6 @@ using NUnit.Framework; using System; using System.Data; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Data { diff --git a/mcs/class/System.Data/Test/System.Data/DataRelationCollectionTest.cs b/mcs/class/System.Data/Test/System.Data/DataRelationCollectionTest.cs index 7da3dca21f0..9ba7870e7e0 100644 --- a/mcs/class/System.Data/Test/System.Data/DataRelationCollectionTest.cs +++ b/mcs/class/System.Data/Test/System.Data/DataRelationCollectionTest.cs @@ -30,9 +30,6 @@ using NUnit.Framework; using System; using System.Data; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Data { diff --git a/mcs/class/System.Data/Test/System.Data/DataRelationTest.cs b/mcs/class/System.Data/Test/System.Data/DataRelationTest.cs index 63d75f2c410..f020a208e6f 100644 --- a/mcs/class/System.Data/Test/System.Data/DataRelationTest.cs +++ b/mcs/class/System.Data/Test/System.Data/DataRelationTest.cs @@ -34,9 +34,6 @@ using NUnit.Framework; using System; using System.Data; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Data { diff --git a/mcs/class/System.Data/Test/System.Data/UniqueConstraintTest.cs b/mcs/class/System.Data/Test/System.Data/UniqueConstraintTest.cs index 2be7b264d09..b1f4d2d1b7c 100644 --- a/mcs/class/System.Data/Test/System.Data/UniqueConstraintTest.cs +++ b/mcs/class/System.Data/Test/System.Data/UniqueConstraintTest.cs @@ -33,9 +33,6 @@ using NUnit.Framework; using System; using System.Data; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Data { diff --git a/mcs/class/System.Drawing/System.Drawing_test.dll.sources b/mcs/class/System.Drawing/System.Drawing_test.dll.sources index 83e8ca47378..4b7cf62280f 100644 --- a/mcs/class/System.Drawing/System.Drawing_test.dll.sources +++ b/mcs/class/System.Drawing/System.Drawing_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs ../../../build/common/Locale.cs ../System.Drawing/gdipEnums.cs ../System.Drawing/gdipFunctions.cs diff --git a/mcs/class/System.Drawing/Test/DrawingTest/Test/Graphics.cs b/mcs/class/System.Drawing/Test/DrawingTest/Test/Graphics.cs index 98485656057..061d5e3ed70 100644 --- a/mcs/class/System.Drawing/Test/DrawingTest/Test/Graphics.cs +++ b/mcs/class/System.Drawing/Test/DrawingTest/Test/Graphics.cs @@ -38,9 +38,6 @@ using System.Drawing.Text; using System.Drawing.Imaging; using DrawingTestHelper; using System.IO; -#if !MONOTOUCH -using NUnit.Framework.SyntaxHelpers; -#endif namespace Test.Sys.Drawing.GraphicsFixtures { #region GraphicsFixtureProps diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources index ff09e03824c..8aae7d9e602 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs System.Runtime.Remoting.Channels.Tcp/TcpChannelTest.cs ServerObject.cs ContextsTest.cs diff --git a/mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs b/mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs index 831c69e72b5..45f76791b7c 100644 --- a/mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs +++ b/mcs/class/System.Runtime.Remoting/Test/IpcChannelTest.cs @@ -78,7 +78,7 @@ namespace MonoTests.Remoting IpcServerChannel chan = new IpcServerChannel (channelName, portName); string[] uris = chan.GetUrlsForUri ("server.rem"); Assert.IsNotNull (uris); - Assert.Greater (uris.Length, 0); + AssertHelper.Greater (uris.Length, 0); bool found = false; foreach (string s in uris) { @@ -101,7 +101,7 @@ namespace MonoTests.Remoting IpcChannel chan = new IpcChannel (props, null, null); string[] uris = chan.GetUrlsForUri ("server.rem"); Assert.IsNotNull (uris); - Assert.Greater (uris.Length, 0); + AssertHelper.Greater (uris.Length, 0); bool found = false; foreach (string s in uris) { diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/CollectionSerialization.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/CollectionSerialization.cs index 7a3834dd93c..cda78a94112 100644 --- a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/CollectionSerialization.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/CollectionSerialization.cs @@ -38,9 +38,6 @@ using System.Runtime.Serialization; using System.ServiceModel; using NUnit.Framework; using NUnit.Framework.Constraints; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Runtime.Serialization { diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractExporterTest2.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractExporterTest2.cs index 6a9b66a6485..9f4c6e14fd7 100644 --- a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractExporterTest2.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractExporterTest2.cs @@ -44,7 +44,6 @@ using System.Xml.Serialization; using Microsoft.CSharp; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; using QName = System.Xml.XmlQualifiedName; diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractImporterTest2.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractImporterTest2.cs index bee52d3e4f8..7e86906afe3 100644 --- a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractImporterTest2.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/XsdDataContractImporterTest2.cs @@ -43,7 +43,6 @@ using System.Xml.Serialization; using Microsoft.CSharp; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; using QName = System.Xml.XmlQualifiedName; diff --git a/mcs/class/System.ServiceModel/System.ServiceModel_test.dll.sources b/mcs/class/System.ServiceModel/System.ServiceModel_test.dll.sources index d06cb33fe21..c788a402138 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel_test.dll.sources +++ b/mcs/class/System.ServiceModel/System.ServiceModel_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs NUnitMoonHelper.cs FeatureBased/Features.Client/AsyncCallTesterProxy.cs FeatureBased/Features.Client/AsyncPatternServer.cs diff --git a/mcs/class/System.ServiceModel/Test/MetadataTests/BindingTestAssertions.cs b/mcs/class/System.ServiceModel/Test/MetadataTests/BindingTestAssertions.cs index b85b9f02f4c..d9b75a637c6 100644 --- a/mcs/class/System.ServiceModel/Test/MetadataTests/BindingTestAssertions.cs +++ b/mcs/class/System.ServiceModel/Test/MetadataTests/BindingTestAssertions.cs @@ -37,7 +37,6 @@ using System.ServiceModel.Channels; using System.ServiceModel.Description; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; using QName = System.Xml.XmlQualifiedName; using WS = System.Web.Services.Description; diff --git a/mcs/class/System.ServiceModel/Test/MetadataTests/ExportTests.cs b/mcs/class/System.ServiceModel/Test/MetadataTests/ExportTests.cs index 3bd64b70ded..a4cbb9cd3ee 100644 --- a/mcs/class/System.ServiceModel/Test/MetadataTests/ExportTests.cs +++ b/mcs/class/System.ServiceModel/Test/MetadataTests/ExportTests.cs @@ -36,7 +36,6 @@ using WS = System.Web.Services.Description; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; namespace MonoTests.System.ServiceModel.MetadataTests { diff --git a/mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests.cs b/mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests.cs index f43655c5736..6262109c116 100644 --- a/mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests.cs +++ b/mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests.cs @@ -34,7 +34,6 @@ using System.ServiceModel.Channels; using System.ServiceModel.Description; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; using WS = System.Web.Services.Description; diff --git a/mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests_LoadMetadata.cs b/mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests_LoadMetadata.cs index 3a92db121d5..4da65c703a5 100644 --- a/mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests_LoadMetadata.cs +++ b/mcs/class/System.ServiceModel/Test/MetadataTests/ImportTests_LoadMetadata.cs @@ -34,7 +34,6 @@ using System.ServiceModel.Channels; using System.ServiceModel.Description; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; namespace MonoTests.System.ServiceModel.MetadataTests { diff --git a/mcs/class/System.ServiceModel/Test/MetadataTests/MiscImportTests.cs b/mcs/class/System.ServiceModel/Test/MetadataTests/MiscImportTests.cs index f6656e5c7d9..1e5c270d988 100644 --- a/mcs/class/System.ServiceModel/Test/MetadataTests/MiscImportTests.cs +++ b/mcs/class/System.ServiceModel/Test/MetadataTests/MiscImportTests.cs @@ -34,7 +34,6 @@ using System.ServiceModel.Channels; using System.ServiceModel.Description; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; using WS = System.Web.Services.Description; diff --git a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Channels/MessageEncoderTest.cs b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Channels/MessageEncoderTest.cs index 19560b93150..2acf8f04b81 100644 --- a/mcs/class/System.ServiceModel/Test/System.ServiceModel.Channels/MessageEncoderTest.cs +++ b/mcs/class/System.ServiceModel/Test/System.ServiceModel.Channels/MessageEncoderTest.cs @@ -34,7 +34,6 @@ using System.ServiceModel.Description; using System.Text; using NUnit.Framework; using NUnit.Framework.Constraints; -using NUnit.Framework.SyntaxHelpers; using TextElement = System.ServiceModel.Channels.TextMessageEncodingBindingElement; using BinaryElement = System.ServiceModel.Channels.BinaryMessageEncodingBindingElement; diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess_test.dll.sources b/mcs/class/System.ServiceProcess/System.ServiceProcess_test.dll.sources index 6a85bfc9e8d..23c4a7ed6b8 100644 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess_test.dll.sources +++ b/mcs/class/System.ServiceProcess/System.ServiceProcess_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs System.ServiceProcess/ServiceBaseTest.cs System.ServiceProcess/ServiceControllerTest.cs System.ServiceProcess/ServiceControllerPermissionAttributeTest.cs diff --git a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources index f23cf2edc1f..548d7271a6c 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources +++ b/mcs/class/System.Threading.Tasks.Dataflow/System.Threading.Tasks.Dataflow_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs TestScheduler.cs AssertEx.cs Blocks.cs diff --git a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs index bec9f30a188..46953497fd3 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs +++ b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/BoundedCapacityTest.cs @@ -131,7 +131,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Assert.IsTrue (transform.Post (1)); Assert.IsTrue (transform.Post (2)); - Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1); + AssertHelper.GreaterOrEqual (scheduler.ExecuteAll (), 1); Assert.AreEqual (2, Volatile.Read (ref n)); } @@ -154,7 +154,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Assert.IsTrue (transform.Post (1)); Assert.IsTrue (transform.Post (2)); - Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1); + AssertHelper.GreaterOrEqual (scheduler.ExecuteAll (), 1); Assert.AreEqual (2, Volatile.Read (ref n)); } @@ -177,7 +177,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { Assert.IsFalse (transform.Post (101)); - Assert.GreaterOrEqual (scheduler.ExecuteAll (), 1); + AssertHelper.GreaterOrEqual (scheduler.ExecuteAll (), 1); Assert.IsFalse (transform.Post (102)); diff --git a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs index 6d879320584..087385c2ffc 100644 --- a/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs +++ b/mcs/class/System.Threading.Tasks.Dataflow/Test/System.Threading.Tasks.Dataflow/OptionsTest.cs @@ -90,7 +90,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { var queue = new ConcurrentQueue> (); var block = factory (queue); - Assert.IsEmpty (queue); + CollectionAssert.IsEmpty (queue); for (int i = 0; i < 100; i++) block.Post (i); @@ -170,15 +170,15 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { options = new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 2 }; foreach (var taskIds in GetTaskIdsForExecutionsOptions (options)) - Assert.LessOrEqual (CalculateDegreeOfParallelism (taskIds), 2); + AssertHelper.LessOrEqual (CalculateDegreeOfParallelism (taskIds), 2); options = new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 4 }; foreach (var taskIds in GetTaskIdsForExecutionsOptions (options)) - Assert.LessOrEqual (CalculateDegreeOfParallelism (taskIds), 4); + AssertHelper.LessOrEqual (CalculateDegreeOfParallelism (taskIds), 4); options = new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = -1 }; foreach (var taskIds in GetTaskIdsForExecutionsOptions (options)) - Assert.LessOrEqual (CalculateDegreeOfParallelism (taskIds), taskIds.Length); + AssertHelper.LessOrEqual (CalculateDegreeOfParallelism (taskIds), taskIds.Length); } } @@ -187,7 +187,7 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { { var options = new ExecutionDataflowBlockOptions (); foreach (var taskIds in GetTaskIdsForExecutionsOptions (options)) - Assert.GreaterOrEqual (taskIds.Distinct ().Count (), 1); + AssertHelper.GreaterOrEqual (taskIds.Distinct ().Count (), 1); options = new ExecutionDataflowBlockOptions { MaxMessagesPerTask = 1 }; foreach (var taskIds in GetTaskIdsForExecutionsOptions (options)) @@ -195,11 +195,11 @@ namespace MonoTests.System.Threading.Tasks.Dataflow { options = new ExecutionDataflowBlockOptions { MaxMessagesPerTask = 2 }; foreach (var taskIds in GetTaskIdsForExecutionsOptions (options)) - Assert.GreaterOrEqual (taskIds.Distinct ().Count (), taskIds.Length / 2); + AssertHelper.GreaterOrEqual (taskIds.Distinct ().Count (), taskIds.Length / 2); options = new ExecutionDataflowBlockOptions { MaxMessagesPerTask = 4 }; foreach (var taskIds in GetTaskIdsForExecutionsOptions (options)) - Assert.GreaterOrEqual (taskIds.Distinct ().Count (), taskIds.Length / 4); + AssertHelper.GreaterOrEqual (taskIds.Distinct ().Count (), taskIds.Length / 4); } [Test] diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData_test.dll.sources b/mcs/class/System.Web.DynamicData/System.Web.DynamicData_test.dll.sources index f619c25efb8..f32bc204565 100644 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData_test.dll.sources +++ b/mcs/class/System.Web.DynamicData/System.Web.DynamicData_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs ../../System.Web/Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/crc32.cs ../../System.Web/Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/Header.cs ../../System.Web/Test/mainsoft/MainsoftWebTest/HtmlAgilityPack/HtmlAttribute.cs diff --git a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs index 4398b8bf4f5..76d1ccedb18 100644 --- a/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs +++ b/mcs/class/System.Web.DynamicData/Test/System.Web.DynamicData/FieldTemplateFactoryTest.cs @@ -647,7 +647,7 @@ namespace MonoTests.System.Web.DynamicData // Custom with UIHint attribute mc = t.GetColumn ("CustomColumn2"); Assert.IsNotNull (mc.UIHint, "#A2"); - Assert.Greater (mc.UIHint.Length, 0, "#A2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#A2-1"); // Proves that UIHint on the column is not used, just the uiHint argument AssertExtensions.Throws (() => { @@ -669,7 +669,7 @@ namespace MonoTests.System.Web.DynamicData // Custom with UIHint attribute mc = t.GetColumn ("CustomColumn4"); Assert.IsNotNull (mc.UIHint, "#A4"); - Assert.Greater (mc.UIHint.Length, 0, "#A4-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#A4-1"); // Proves that UIHint on the column is not used, just the uiHint argument Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#A4-2"); @@ -686,7 +686,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("DateTimeColumn2"); Assert.IsNotNull (mc.UIHint, "#B2"); - Assert.Greater (mc.UIHint.Length, 0, "#B2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#B2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "DateTime.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#B2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "DateTime.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#B2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "DateTime.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#B2-5"); @@ -701,7 +701,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("DateColumn2"); Assert.IsNotNull (mc.UIHint, "#C2"); - Assert.Greater (mc.UIHint.Length, 0, "#C2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#C2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#C2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#C2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#C2-5"); @@ -715,7 +715,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("DateColumn4"); Assert.IsNotNull (mc.UIHint, "#C4"); - Assert.Greater (mc.UIHint.Length, 0, "#C4-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#C4-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#C4-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#C4-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#C4-5"); @@ -730,7 +730,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("TimeColumn2"); Assert.IsNotNull (mc.UIHint, "#D2"); - Assert.Greater (mc.UIHint.Length, 0, "#D2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#D2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#D2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#D2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#D2-5"); @@ -745,7 +745,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("DurationColumn2"); Assert.IsNotNull (mc.UIHint, "#E2"); - Assert.Greater (mc.UIHint.Length, 0, "#E2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#E2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#E2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#E2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#E2-5"); @@ -760,7 +760,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("PhoneNumberColumn2"); Assert.IsNotNull (mc.UIHint, "#F2"); - Assert.Greater (mc.UIHint.Length, 0, "#F2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#F2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#F2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#F2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#F2-5"); @@ -775,7 +775,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("CurrencyColumn2"); Assert.IsNotNull (mc.UIHint, "#G2"); - Assert.Greater (mc.UIHint.Length, 0, "#G2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#G2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#G2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#G2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#G2-5"); @@ -790,7 +790,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("TextColumn2"); Assert.IsNotNull (mc.UIHint, "#H2"); - Assert.Greater (mc.UIHint.Length, 0, "#H2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#H2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#H2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#H2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#H2-5"); @@ -805,7 +805,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("HtmlColumn2"); Assert.IsNotNull (mc.UIHint, "#I2"); - Assert.Greater (mc.UIHint.Length, 0, "#I2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#I2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#I2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#I2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#I2-5"); @@ -820,7 +820,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("MultilineTextColumn2"); Assert.IsNotNull (mc.UIHint, "#J2"); - Assert.Greater (mc.UIHint.Length, 0, "#J2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#J2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#J2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#J2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#J2-5"); @@ -835,7 +835,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("EmailAddressColumn2"); Assert.IsNotNull (mc.UIHint, "#K2"); - Assert.Greater (mc.UIHint.Length, 0, "#K2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#K2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#K2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#K2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#K2-5"); @@ -850,7 +850,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("PasswordColumn2"); Assert.IsNotNull (mc.UIHint, "#L2"); - Assert.Greater (mc.UIHint.Length, 0, "#L2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#L2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#L2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#L2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#L2-5"); @@ -865,7 +865,7 @@ namespace MonoTests.System.Web.DynamicData mc = t.GetColumn ("UrlColumn2"); Assert.IsNotNull (mc.UIHint, "#M2"); - Assert.Greater (mc.UIHint.Length, 0, "#M2-1"); + AssertHelper.Greater (mc.UIHint.Length, 0, "#M2-1"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, null), "#M2-3"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, String.Empty), "#M2-4"); Assert.AreEqual (ftf.TemplateFolderVirtualPath + "Text.ascx", ftf.GetFieldTemplateVirtualPath (mc, DataBoundControlMode.ReadOnly, "Boolean.ascx"), "#M2-5"); diff --git a/mcs/class/System.Web/System.Web_standalone_test.dll.sources b/mcs/class/System.Web/System.Web_standalone_test.dll.sources index 09bd670bd4d..47a1fa4a8de 100644 --- a/mcs/class/System.Web/System.Web_standalone_test.dll.sources +++ b/mcs/class/System.Web/System.Web_standalone_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs Test/standalone-tests/Consts.cs Test/standalone-tests/Locations.cs Test/standalone-tests/OutputCacheProvider.cs diff --git a/mcs/class/System.Web/System.Web_test.dll.sources b/mcs/class/System.Web/System.Web_test.dll.sources index 4416f5a698b..70593c25d06 100644 --- a/mcs/class/System.Web/System.Web_test.dll.sources +++ b/mcs/class/System.Web/System.Web_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs ../../System.Web.DynamicData/Test/Common/AssertExtensions.cs mainsoft/MainsoftWebTest/HtmlAgilityPack/AssemblyInfo.cs mainsoft/MainsoftWebTest/HtmlAgilityPack/crc32.cs diff --git a/mcs/class/System.Web/Test/System.Web.Hosting/HostingEnvironmentTest.cs b/mcs/class/System.Web/Test/System.Web.Hosting/HostingEnvironmentTest.cs index 22f3996e76b..e240e4355ff 100644 --- a/mcs/class/System.Web/Test/System.Web.Hosting/HostingEnvironmentTest.cs +++ b/mcs/class/System.Web/Test/System.Web.Hosting/HostingEnvironmentTest.cs @@ -77,13 +77,13 @@ namespace MonoTests.System.Web.Hosting { Assert.IsNull (HostingEnvironment.InitializationException, "During:InitializationException"); Assert.IsTrue (HostingEnvironment.IsHosted, "During:IsHosted"); Assert.IsNotNull (HostingEnvironment.ApplicationID, "During:ApplicationID:Null"); - Assert.IsNotEmpty (HostingEnvironment.ApplicationID, "During:ApplicationID:Empty"); + AssertHelper.IsNotEmpty (HostingEnvironment.ApplicationID, "During:ApplicationID:Empty"); Assert.IsNotNull (HostingEnvironment.ApplicationPhysicalPath, "During:ApplicationPhysicalPath:Null"); - Assert.IsNotEmpty (HostingEnvironment.ApplicationPhysicalPath, "During:ApplicationPhysicalPath:Empty"); + AssertHelper.IsNotEmpty (HostingEnvironment.ApplicationPhysicalPath, "During:ApplicationPhysicalPath:Empty"); Assert.IsNotNull (HostingEnvironment.ApplicationVirtualPath, "During:ApplicationVirtualPath:Null"); - Assert.IsNotEmpty (HostingEnvironment.ApplicationVirtualPath, "During:ApplicationVirtualPath:Empty"); + AssertHelper.IsNotEmpty (HostingEnvironment.ApplicationVirtualPath, "During:ApplicationVirtualPath:Empty"); Assert.IsNotNull (HostingEnvironment.SiteName, "During:SiteName:Null"); - Assert.IsNotEmpty (HostingEnvironment.SiteName, "During:SiteName:Empty"); + AssertHelper.IsNotEmpty (HostingEnvironment.SiteName, "During:SiteName:Empty"); Assert.IsNotNull (HostingEnvironment.Cache, "During:Cache"); Assert.AreEqual (ApplicationShutdownReason.None, HostingEnvironment.ShutdownReason, "During:ShutdownReason"); Assert.IsNotNull (HostingEnvironment.VirtualPathProvider, "During:VirtualPathProvider"); diff --git a/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs b/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs index 2ce8621aec4..0342a707978 100644 --- a/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs +++ b/mcs/class/System.Web/Test/System.Web/HttpResponseTest.cs @@ -547,7 +547,7 @@ namespace MonoTests.System.Web { KnownResponseHeader known; - Assert.LessOrEqual (1, f.KnownResponseHeaders.Count, "#B1"); + AssertHelper.LessOrEqual (1, f.KnownResponseHeaders.Count, "#B1"); known = (KnownResponseHeader)f.KnownResponseHeaders ["Content-Type"]; Assert.AreEqual (HttpWorkerRequest.HeaderContentType, known.Index, "#B2"); @@ -571,7 +571,7 @@ namespace MonoTests.System.Web { KnownResponseHeader known; - Assert.LessOrEqual (1, f.KnownResponseHeaders.Count, "#B1"); + AssertHelper.LessOrEqual (1, f.KnownResponseHeaders.Count, "#B1"); known = (KnownResponseHeader)f.KnownResponseHeaders ["Content-Type"]; Assert.AreEqual (HttpWorkerRequest.HeaderContentType, known.Index, "#B2"); diff --git a/mcs/class/System.Web/Test/System.Web/XmlSiteMapProviderTest.cs b/mcs/class/System.Web/Test/System.Web/XmlSiteMapProviderTest.cs index 23487dacb07..73c5c75bb2c 100644 --- a/mcs/class/System.Web/Test/System.Web/XmlSiteMapProviderTest.cs +++ b/mcs/class/System.Web/Test/System.Web/XmlSiteMapProviderTest.cs @@ -148,7 +148,7 @@ namespace MonoTests.System.Web provider.DoAddNode (node, rootNode); Assert.IsNotNull (provider.CallTrace, "#A1"); - Assert.Greater (provider.CallTrace.Length, 1, "#A1-1"); + AssertHelper.Greater (provider.CallTrace.Length, 1, "#A1-1"); Assert.AreEqual (provider.CallTrace[0].Name, "BuildSiteMap", "#A1-2"); } @@ -247,7 +247,7 @@ namespace MonoTests.System.Web Assert.IsNotNull (provider.RootNode, "#A1"); Assert.AreEqual (provider.RootNode.Provider, provider, "#A2"); Assert.IsNotNull (provider.CallTrace, "#A3"); - Assert.Greater (provider.CallTrace.Length, 1, "#A3-1"); + AssertHelper.Greater (provider.CallTrace.Length, 1, "#A3-1"); Assert.AreEqual ("BuildSiteMap", provider.CallTrace[0].Name, "#A3-2"); Assert.AreEqual ("get_RootNode", provider.CallTrace[1].Name, "#A3-3"); } diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms_test.dll.sources b/mcs/class/System.Windows.Forms/System.Windows.Forms_test.dll.sources index f336b1537be..884953ac3dd 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms_test.dll.sources +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs ../../../build/common/Consts.cs System.Windows.Forms/ApplicationTest.cs System.Windows.Forms/AutoCompleteStringCollectionTest.cs diff --git a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeFileRefGetValueTests.cs b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeFileRefGetValueTests.cs index d0e3fc1bd3d..0414fa18e71 100644 --- a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeFileRefGetValueTests.cs +++ b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeFileRefGetValueTests.cs @@ -47,7 +47,7 @@ namespace MonoTests.System.Resources { Assert.IsNotNull (returnedNode, "#A1"); object val = returnedNode.GetValue (new ReturnSerializableSubClassITRS ()); - Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A2"); + AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A2"); Assert.IsInstanceOfType (typeof (serializable), val, "#A3"); } @@ -84,7 +84,7 @@ namespace MonoTests.System.Resources { node = GetNodeFileRefToSerializable ("ser.bbb",true); object val = node.GetValue (new ReturnSerializableSubClassITRS ()); - Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A1"); + AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A1"); Assert.IsInstanceOfType (typeof (serializable), val, "#A2"); } diff --git a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerialisedGetValueTypeNameTests.cs b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerialisedGetValueTypeNameTests.cs index 8ca5f4eb574..3c0fc3beaaf 100644 --- a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerialisedGetValueTypeNameTests.cs +++ b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerialisedGetValueTypeNameTests.cs @@ -90,7 +90,7 @@ namespace MonoTests.System.Resources { // get value passing no params object val = returnedNode.GetValue ((ITypeResolutionService) null); Assert.IsInstanceOfType (typeof (serializable), val, "#A2"); - Assert.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A3"); + AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), val, "#A3"); //get value type passing different params string newType = returnedNode.GetValueTypeName (new ReturnSerializableSubClassITRS ()); diff --git a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerializedGetValueTests.cs b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerializedGetValueTests.cs index d27d4439bb6..ffd3711a8c2 100644 --- a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerializedGetValueTests.cs +++ b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeSerializedGetValueTests.cs @@ -50,10 +50,10 @@ namespace MonoTests.System.Resources { object defaultVal = returnedNode.GetValue ((ITypeResolutionService) null); Assert.IsInstanceOfType (typeof (serializable), defaultVal, "#A2"); - Assert.IsNotInstanceOfType (typeof (serializableSubClass), defaultVal, "#A3"); + AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), defaultVal, "#A3"); object newVal = returnedNode.GetValue (new ReturnSerializableSubClassITRS ()); - Assert.IsNotInstanceOfType (typeof (serializableSubClass), newVal, "#A4"); + AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), newVal, "#A4"); Assert.IsInstanceOfType (typeof (serializable), newVal, "#A5"); } @@ -88,7 +88,7 @@ namespace MonoTests.System.Resources { // get value passing null params object val = returnedNode.GetValue ((ITypeResolutionService) null); - // Assert.IsNotInstanceOfType (typeof (serializable), val, "#A5"); this would fail as subclasses are id-ed as instances of parents + // AssertHelper.IsNotInstanceOfType (typeof (serializable), val, "#A5"); this would fail as subclasses are id-ed as instances of parents Assert.IsInstanceOfType (typeof (serializableSubClass), val, "#A4"); } diff --git a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeTest.cs b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeTest.cs index 3a6cfbda95a..5c6d1a960cc 100644 --- a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeTest.cs +++ b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeTest.cs @@ -314,7 +314,7 @@ namespace MonoTests.System.Resources { object o = node.GetValue ((AssemblyName []) null); - Assert.IsNotInstanceOfType (typeof (serializableSubClass), o, "#A2"); + AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), o, "#A2"); Assert.IsInstanceOfType (typeof (serializable), o, "#A3"); rr.Close (); } diff --git a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeWriteBehavior.cs b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeWriteBehavior.cs index 6c69a328a08..9bfe7b1b416 100644 --- a/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeWriteBehavior.cs +++ b/mcs/class/System.Windows.Forms/Test/System.Resources/ResXDataNodeWriteBehavior.cs @@ -252,7 +252,7 @@ namespace MonoTests.System.Resources { Assert.IsNotNull (finalNode, "#A3"); object finalVal = finalNode.GetValue ((ITypeResolutionService) null); - Assert.IsNotInstanceOfType (typeof (serializableSubClass), finalVal, "#A4"); + AssertHelper.IsNotInstanceOfType (typeof (serializableSubClass), finalVal, "#A4"); Assert.IsInstanceOfType (typeof (serializable), finalVal, "#A5"); } diff --git a/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs b/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs index acade5f6933..18271cfba2d 100644 --- a/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs +++ b/mcs/class/System.Windows.Forms/Test/System.Windows.Forms/TableLayoutTest.cs @@ -946,10 +946,10 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (31, p.GetRowHeights ()[0], "D1"); Assert.AreEqual (31, p.GetRowHeights ()[1], "D2"); Assert.AreEqual (81, p.GetColumnWidths ()[0], "D3"); - Assert.LessOrEqual (75, p.GetColumnWidths ()[1], "D4"); - Assert.GreaterOrEqual (78, p.GetColumnWidths ()[1], "D5"); - Assert.LessOrEqual (78, p.GetColumnWidths ()[2], "D6"); - Assert.GreaterOrEqual (81, p.GetColumnWidths ()[2], "D7"); + AssertHelper.LessOrEqual (75, p.GetColumnWidths ()[1], "D4"); + AssertHelper.GreaterOrEqual (78, p.GetColumnWidths ()[1], "D5"); + AssertHelper.LessOrEqual (78, p.GetColumnWidths ()[2], "D6"); + AssertHelper.GreaterOrEqual (81, p.GetColumnWidths ()[2], "D7"); } [Test] @@ -1702,7 +1702,7 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (4, tlp.RowCount, "X18638-1"); Assert.AreEqual (3, tlp.ColumnCount, "X18638-2"); Assert.AreEqual (60, widths[0], "X18638-3"); - Assert.Greater (label2.Width, widths[1], "X18638-5"); + AssertHelper.Greater (label2.Width, widths[1], "X18638-5"); Assert.AreEqual (45, widths[2], "X18638-4"); } diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq_test.dll.sources b/mcs/class/System.Xml.Linq/System.Xml.Linq_test.dll.sources index 693d4a2e296..67efb6025e6 100644 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq_test.dll.sources +++ b/mcs/class/System.Xml.Linq/System.Xml.Linq_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs System.Xml.Linq/ExtensionsTest.cs System.Xml.Linq/XAttributeTest.cs System.Xml.Linq/XCommentTest.cs diff --git a/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs b/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs index da577e644ef..bbbf42e13f5 100644 --- a/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs +++ b/mcs/class/System.Xml.Linq/Test/System.Xml.Schema/ExtensionsTest.cs @@ -220,8 +220,8 @@ namespace MonoTests.System.Xml.Schema } } - Assert.GreaterOrEqual (afterNoOfAttributes, beforeNoOfAttributes, "newAttributes"); - Assert.GreaterOrEqual (afterNoOfElements, beforeNoOfElements, "newElements"); + AssertHelper.GreaterOrEqual (afterNoOfAttributes, beforeNoOfAttributes, "newAttributes"); + AssertHelper.GreaterOrEqual (afterNoOfElements, beforeNoOfElements, "newElements"); } /* diff --git a/mcs/class/System/System_test.dll.sources b/mcs/class/System/System_test.dll.sources index 6ec32758faf..24351699070 100644 --- a/mcs/class/System/System_test.dll.sources +++ b/mcs/class/System/System_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs Microsoft.CSharp/CodeGeneratorFromCompileUnitTest.cs Microsoft.CSharp/CodeGeneratorFromExpressionTest.cs Microsoft.CSharp/CodeGeneratorFromNamespaceTest.cs diff --git a/mcs/class/System/Test/System.CodeDom.Compiler/CodeGeneratorGenerateFromCompileUnitTest.cs b/mcs/class/System/Test/System.CodeDom.Compiler/CodeGeneratorGenerateFromCompileUnitTest.cs index c6ccdf0a26a..823204cf486 100644 --- a/mcs/class/System/Test/System.CodeDom.Compiler/CodeGeneratorGenerateFromCompileUnitTest.cs +++ b/mcs/class/System/Test/System.CodeDom.Compiler/CodeGeneratorGenerateFromCompileUnitTest.cs @@ -53,7 +53,7 @@ namespace MonoTests.System.CodeDom.Compiler int importPosition = result.IndexOf (IMPORT); int attributePosition = result.IndexOf (ATTRIBUTE); - Assert.Greater (attributePosition, importPosition, "Actual order: " + result); + AssertHelper.Greater (attributePosition, importPosition, "Actual order: " + result); } [Test] diff --git a/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs b/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs index b6baac08e85..6586c4c092f 100644 --- a/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs +++ b/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs @@ -38,9 +38,6 @@ using System.Text; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Collections.Generic { diff --git a/mcs/class/System/Test/System.Diagnostics/SourceSwitchTest.cs b/mcs/class/System/Test/System.Diagnostics/SourceSwitchTest.cs index 820e84d2a89..07195bb9246 100644 --- a/mcs/class/System/Test/System.Diagnostics/SourceSwitchTest.cs +++ b/mcs/class/System/Test/System.Diagnostics/SourceSwitchTest.cs @@ -53,7 +53,7 @@ namespace MonoTests.System.Diagnostics public void ConstructorNullName () { SourceSwitch s = new SourceSwitch (null); - Assert.IsEmpty (s.DisplayName); + AssertHelper.IsEmpty (s.DisplayName); } [Test] diff --git a/mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs b/mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs index 9d97fc8b53c..d8821a00c2d 100644 --- a/mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs +++ b/mcs/class/System/Test/System.Diagnostics/SwitchesTest.cs @@ -190,8 +190,8 @@ namespace MonoTests.System.Diagnostics { public void NullSwitchHasEmptyDisplayNameAndDescription () { var s = new TestNullSwitch (); - Assert.IsEmpty (s.DisplayName); - Assert.IsEmpty (s.Description); + AssertHelper.IsEmpty (s.DisplayName); + AssertHelper.IsEmpty (s.Description); } } } diff --git a/mcs/class/WebMatrix.Data/WebMatrix.Data_test.dll.sources b/mcs/class/WebMatrix.Data/WebMatrix.Data_test.dll.sources index 927528aa296..0d885863e40 100644 --- a/mcs/class/WebMatrix.Data/WebMatrix.Data_test.dll.sources +++ b/mcs/class/WebMatrix.Data/WebMatrix.Data_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs WebMatrix.Data/ConnectionEventArgsTests.cs WebMatrix.Data/DynamicRecordTests.cs ../WebMatrix.Data/DynamicRecord.cs diff --git a/mcs/class/WindowsBase/WindowsBase_test.dll.sources b/mcs/class/WindowsBase/WindowsBase_test.dll.sources index 64a199a988f..620b1628eb8 100644 --- a/mcs/class/WindowsBase/WindowsBase_test.dll.sources +++ b/mcs/class/WindowsBase/WindowsBase_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs System.Collections.ObjectModel/ObservableCollectionTest.cs System.Collections.ObjectModel/ReadOnlyObservableCollectionTest.cs System.Collections.Specialized/NotifyCollectionChangedEventArgsTest.cs diff --git a/mcs/class/corlib/Test/Mono/DataConvertTest.cs b/mcs/class/corlib/Test/Mono/DataConvertTest.cs index f02a6a7db40..4ac94d59e1f 100644 --- a/mcs/class/corlib/Test/Mono/DataConvertTest.cs +++ b/mcs/class/corlib/Test/Mono/DataConvertTest.cs @@ -4,10 +4,6 @@ using System.Text; using NUnit.Framework; using Mono; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif - namespace MonoTests.Mono { [TestFixture] diff --git a/mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentDictionaryTests.cs b/mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentDictionaryTests.cs index 70c250d015d..75b2de89aac 100644 --- a/mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentDictionaryTests.cs +++ b/mcs/class/corlib/Test/System.Collections.Concurrent/ConcurrentDictionaryTests.cs @@ -32,9 +32,6 @@ using System.Collections.Concurrent; using NUnit; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Collections.Concurrent { diff --git a/mcs/class/corlib/Test/System.Collections.Concurrent/PartitionerTests.cs b/mcs/class/corlib/Test/System.Collections.Concurrent/PartitionerTests.cs index 9cd2d1e1113..4bf774937d5 100644 --- a/mcs/class/corlib/Test/System.Collections.Concurrent/PartitionerTests.cs +++ b/mcs/class/corlib/Test/System.Collections.Concurrent/PartitionerTests.cs @@ -30,9 +30,6 @@ using System.Collections.Generic; using System.Collections.Concurrent; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Collections.Concurrent { diff --git a/mcs/class/corlib/Test/System.Security.AccessControl/RawSecurityDescriptorTest.cs b/mcs/class/corlib/Test/System.Security.AccessControl/RawSecurityDescriptorTest.cs index bf93320e26b..7a0e837cacf 100644 --- a/mcs/class/corlib/Test/System.Security.AccessControl/RawSecurityDescriptorTest.cs +++ b/mcs/class/corlib/Test/System.Security.AccessControl/RawSecurityDescriptorTest.cs @@ -9,7 +9,6 @@ using System; using System.Security.AccessControl; using System.Security.Principal; using NUnit.Framework; -using NUnit.Framework.SyntaxHelpers; namespace MonoTests.System.Security.AccessControl { diff --git a/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs b/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs index f35a9d38830..ea6380d0977 100644 --- a/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs +++ b/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs @@ -10,10 +10,6 @@ using System.Text; using NUnit.Framework; using NUnit.Framework.Constraints; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif - namespace MonoTests.System.Text { [TestFixture] diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskCompletionSourceTests.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskCompletionSourceTests.cs index 903a6946a08..94f191a121a 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskCompletionSourceTests.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskCompletionSourceTests.cs @@ -30,9 +30,6 @@ using System.Threading; using System.Threading.Tasks; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Threading.Tasks { diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs index 94d36a131e5..1af618d3336 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest.cs @@ -35,9 +35,6 @@ using System.Threading.Tasks; using System.Collections.Generic; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Threading.Tasks { diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs index 0ca7f49f474..803b10c15eb 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskFactoryTest_T.cs @@ -32,9 +32,6 @@ using System.Threading; using System.Threading.Tasks; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Threading.Tasks { diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskSchedulerTest.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskSchedulerTest.cs index e8130bc06fd..001f4d454cd 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskSchedulerTest.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskSchedulerTest.cs @@ -29,9 +29,6 @@ using System.Threading.Tasks; using System.Collections.Generic; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Threading.Tasks { diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs index f4e8a9705f7..07bd1fe0b56 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs @@ -34,10 +34,6 @@ using System.Threading.Tasks; using System.Collections.Generic; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif - namespace MonoTests.System.Threading.Tasks { [TestFixture] diff --git a/mcs/class/corlib/Test/System.Threading/ThreadLocalTests.cs b/mcs/class/corlib/Test/System.Threading/ThreadLocalTests.cs index 8c063dccdc8..b65d150bb58 100644 --- a/mcs/class/corlib/Test/System.Threading/ThreadLocalTests.cs +++ b/mcs/class/corlib/Test/System.Threading/ThreadLocalTests.cs @@ -29,9 +29,6 @@ using System.Threading; using NUnit; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif namespace MonoTests.System.Threading { diff --git a/mcs/class/corlib/Test/System/SingleTest.cs b/mcs/class/corlib/Test/System/SingleTest.cs index bf3beb47200..c4d0bd82fc9 100644 --- a/mcs/class/corlib/Test/System/SingleTest.cs +++ b/mcs/class/corlib/Test/System/SingleTest.cs @@ -15,10 +15,6 @@ using System.Threading; using NUnit.Framework; -#if !MOBILE -using NUnit.Framework.SyntaxHelpers; -#endif - namespace MonoTests.System { [TestFixture] diff --git a/mcs/class/corlib/corlib_test.dll.sources b/mcs/class/corlib/corlib_test.dll.sources index bc43d92b920..4e444a37efa 100644 --- a/mcs/class/corlib/corlib_test.dll.sources +++ b/mcs/class/corlib/corlib_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs Microsoft.Win32/RegistryKeyTest.cs Mono/DataConvertTest.cs ../Mono/DataConverter.cs diff --git a/mcs/class/monodoc/Test/Monodoc.Generators/RawGeneratorTests.cs b/mcs/class/monodoc/Test/Monodoc.Generators/RawGeneratorTests.cs index 9af81920a16..fa3ffe15ac5 100644 --- a/mcs/class/monodoc/Test/Monodoc.Generators/RawGeneratorTests.cs +++ b/mcs/class/monodoc/Test/Monodoc.Generators/RawGeneratorTests.cs @@ -47,7 +47,7 @@ namespace MonoTests.Monodoc.Generators { var xml = rootTree.RenderUrl ("T:System.String", generator); Assert.IsNotNull (xml); - Assert.IsNotEmpty (xml); + AssertHelper.IsNotEmpty (xml); AssertValidXml (xml); AssertEcmaFullTypeName (xml, "System.String"); } @@ -57,7 +57,7 @@ namespace MonoTests.Monodoc.Generators { var xml = rootTree.RenderUrl ("T:System.Int32", generator); Assert.IsNotNull (xml); - Assert.IsNotEmpty (xml); + AssertHelper.IsNotEmpty (xml); AssertValidXml (xml); AssertEcmaFullTypeName (xml, "System.Int32"); } diff --git a/mcs/class/monodoc/Test/Monodoc/HelpSourceTests.cs b/mcs/class/monodoc/Test/Monodoc/HelpSourceTests.cs index 867c9b79389..29da7513704 100644 --- a/mcs/class/monodoc/Test/Monodoc/HelpSourceTests.cs +++ b/mcs/class/monodoc/Test/Monodoc/HelpSourceTests.cs @@ -85,7 +85,7 @@ namespace MonoTests.Monodoc // HACK: in reality we have currently 4 known issues which are due to duplicated namespaces across // doc sources, something that was never supported and that we need to improve/fix at some stage - Assert.LessOrEqual (4, errorCount, errorCount + " / " + testCount.ToString ()); + AssertHelper.LessOrEqual (4, errorCount, errorCount + " / " + testCount.ToString ()); } IEnumerable GetLeaves (Node node) diff --git a/mcs/class/monodoc/Test/Monodoc/SettingsTest.cs b/mcs/class/monodoc/Test/Monodoc/SettingsTest.cs index 29ac108da8d..fc6bf8da18a 100644 --- a/mcs/class/monodoc/Test/Monodoc/SettingsTest.cs +++ b/mcs/class/monodoc/Test/Monodoc/SettingsTest.cs @@ -17,7 +17,7 @@ namespace MonoTests.Monodoc { // the docPath variable is the only one we know for sure should exist Assert.IsNotNull (Config.Get ("docPath")); - Assert.IsNotEmpty (Config.Get ("docPath")); + AssertHelper.IsNotEmpty (Config.Get ("docPath")); } } } diff --git a/mcs/class/monodoc/monodoc_test.dll.sources b/mcs/class/monodoc/monodoc_test.dll.sources index b806b8fb6e9..a3f19b731a0 100644 --- a/mcs/class/monodoc/monodoc_test.dll.sources +++ b/mcs/class/monodoc/monodoc_test.dll.sources @@ -1,3 +1,4 @@ +../../test-helpers/NunitHelpers.cs Monodoc/HelpSourceTests.cs Monodoc/EcmaDocTests.cs Monodoc/TreeTest.cs diff --git a/mcs/class/test-helpers/NunitHelpers.cs b/mcs/class/test-helpers/NunitHelpers.cs new file mode 100644 index 00000000000..7ae0ef81faf --- /dev/null +++ b/mcs/class/test-helpers/NunitHelpers.cs @@ -0,0 +1,102 @@ +using System.IO; +using System.Collections; +using NUnit.Framework.Constraints; + +namespace NUnit.Framework +{ + static class CollectionAssert + { + public static void DoesNotContain (IEnumerable collection, object val) + { + Assert.That(collection, Has.No.Member(val)); + } + + public static void Contains (IEnumerable collection, object val) + { + Assert.That(collection, Has.Member(val)); + } + + public static void AreEqual (IEnumerable expected, IEnumerable actual, string message = null, params object[] args) + { + Assert.That(actual, Is.EqualTo(expected), message, args); + } + + public static void AreEquivalent (IEnumerable expected, IEnumerable actual, string message = null, params object[] args) + { + Assert.That(actual, Is.EquivalentTo(expected), message, args); + } + + public static void IsEmpty(IEnumerable collection, string message = null, params object[] args) + { + Assert.That(collection, new EmptyCollectionConstraint(), message, args); + } + } + + static class FileAssert + { + public static void AreEqual(Stream expected, Stream actual, string message, params object[] args) + { + Assert.That(actual, Is.EqualTo(expected), message, args); + } + + public static void AreEqual(string expected, string actual, string message, params object[] args) + { + using (FileStream exStream = File.OpenRead(expected)) + using (FileStream acStream = File.OpenRead(actual)) + { + AreEqual(exStream, acStream, message, args); + } + } + } + + static class StringAssert + { + public static void Contains(string expected, string actual, string message = null, params object[] args) + { + Assert.That(actual, Is.StringContaining (expected), message, args); + } + + public static void StartsWith(string expected, string actual, string message = null, params object[] args) + { + Assert.IsTrue (actual.StartsWith (expected), message, args); + } + } + + static class AssertHelper + { + public static void IsEmpty (string aString, string message = null, params object[] args ) + { + Assert.That(aString, Is.Empty, message, args); + } + + public static void IsNotEmpty (string aString, string message = null, params object[] args ) + { + Assert.That(aString, Is.Not.Empty, message, args); + } + + public static void Greater(int arg1, int arg2, string message = null, params object[] args) + { + Assert.That(arg1, Is.GreaterThan(arg2), message, args); + } + + public static void GreaterOrEqual(int arg1, int arg2, string message = null, params object[] args) + { + Assert.That(arg1, Is.GreaterThanOrEqualTo(arg2), message, args); + } + + public static void GreaterOrEqual(long arg1, long arg2, string message = null, params object[] args) + { + Assert.That(arg1, Is.GreaterThanOrEqualTo(arg2), message, args); + } + + public static void LessOrEqual (int arg1, int arg2, string message = null, params object[] args) + { + Assert.That(arg1, Is.LessThanOrEqualTo(arg2), message, args); + } + + public static void IsNotInstanceOfType(System.Type expected, object actual, string message, params object[] args ) + { + Assert.IsFalse (actual.GetType ().IsInstanceOfType (expected), message, args); + } + } +}