aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Tests/InventoryTests.cs
diff options
context:
space:
mode:
authorAlexRa2010-05-21 15:59:26 +0300
committerAlexRa2010-05-23 11:48:10 +0300
commit2537acc04db736cdc885e23bbfaade690d56fa5f (patch)
tree7078384e80246b6e55191782194bfa7c17ab63a5 /OpenSim/Data/Tests/InventoryTests.cs
parentAdded MS SQL test conn to INI - only as an example, modify before use!!! (diff)
downloadopensim-SC-2537acc04db736cdc885e23bbfaade690d56fa5f.zip
opensim-SC-2537acc04db736cdc885e23bbfaade690d56fa5f.tar.gz
opensim-SC-2537acc04db736cdc885e23bbfaade690d56fa5f.tar.bz2
opensim-SC-2537acc04db736cdc885e23bbfaade690d56fa5f.tar.xz
Unitests: Asset, Estate, Region (the "legacy" one), Inventory
The tests have been modified to work under NUnit 2.4.6 (the one currently used in the project). They will also work with NUnit 2.5+ as is, but will look better if you #define NUNIT25 for them.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/Tests/InventoryTests.cs29
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Data/Tests/InventoryTests.cs b/OpenSim/Data/Tests/InventoryTests.cs
index d5f3be4..93e1eba 100644
--- a/OpenSim/Data/Tests/InventoryTests.cs
+++ b/OpenSim/Data/Tests/InventoryTests.cs
@@ -25,6 +25,8 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28// #define NUNIT25
29
28using System; 30using System;
29using log4net.Config; 31using log4net.Config;
30using NUnit.Framework; 32using NUnit.Framework;
@@ -35,6 +37,10 @@ using log4net;
35using System.Reflection; 37using System.Reflection;
36using System.Data.Common; 38using System.Data.Common;
37 39
40#if !NUNIT25
41using NUnit.Framework.SyntaxHelpers;
42#endif
43
38// DBMS-specific: 44// DBMS-specific:
39using MySql.Data.MySqlClient; 45using MySql.Data.MySqlClient;
40using OpenSim.Data.MySQL; 46using OpenSim.Data.MySQL;
@@ -47,9 +53,29 @@ using OpenSim.Data.SQLite;
47 53
48namespace OpenSim.Data.Tests 54namespace OpenSim.Data.Tests
49{ 55{
56#if NUNIT25
57
58 [TestFixture(typeof(SqliteConnection), typeof(SQLiteInventoryStore), Description = "Inventory store tests (SQLite)")]
50 [TestFixture(typeof(MySqlConnection), typeof(MySQLInventoryData), Description = "Inventory store tests (MySQL)")] 59 [TestFixture(typeof(MySqlConnection), typeof(MySQLInventoryData), Description = "Inventory store tests (MySQL)")]
51 [TestFixture(typeof(SqlConnection), typeof(MSSQLInventoryData), Description = "Inventory store tests (MS SQL Server)")] 60 [TestFixture(typeof(SqlConnection), typeof(MSSQLInventoryData), Description = "Inventory store tests (MS SQL Server)")]
52 [TestFixture(typeof(SqliteConnection), typeof(SQLiteInventoryStore), Description = "Inventory store tests (SQLite)")] 61
62#else
63
64 [TestFixture(Description = "Inventory store tests (SQLite)")]
65 public class SQLiteInventoryTests : InventoryTests<SqliteConnection, SQLiteInventoryStore>
66 {
67 }
68
69 [TestFixture(Description = "Inventory store tests (MySQL)")]
70 public class MySqlInventoryTests : InventoryTests<MySqlConnection, MySQLInventoryData>
71 {
72 }
73
74 [TestFixture(Description = "Inventory store tests (MS SQL Server)")]
75 public class MSSQLInventoryTests : InventoryTests<SqlConnection, MSSQLInventoryData>
76 {
77 }
78#endif
53 79
54 public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore> 80 public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore>
55 where TConn : DbConnection, new() 81 where TConn : DbConnection, new()
@@ -85,6 +111,7 @@ namespace OpenSim.Data.Tests
85 { 111 {
86 name1 = "Root Folder for " + owner1.ToString(); 112 name1 = "Root Folder for " + owner1.ToString();
87 } 113 }
114 public InventoryTests() : this("") { }
88 115
89 protected override void InitService(object service) 116 protected override void InitService(object service)
90 { 117 {