[MonoTODO]
protected override void Dispose (bool disposing)
{
- throw new NotImplementedException ();
}
protected virtual bool ShouldSerializeTableMappings ()
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
-
-#region Using directives
+#if !MOBILE
using System;
using System.Configuration;
using NUnit.Framework;
-#endregion
-
namespace MonoTests.System.Configuration
{
[TestFixture]
}
-#endif // NET_2_0
+#endif
using System.Data.SqlClient;
/*--For Bug 853 Test Begin--*/
+#if !MOBILE
using Mono.Data.Sqlite;
+#endif
/*--For Bug 853 Test End--*/
using NUnit.Framework;
Assert.IsNotNull (ex.Message, "#4");
}
}
-
+#if !MOBILE
[Test]
[Category ("NotWorking")] // Requires newer sqlite than is on wrench
public void XimarinBugzillaBug853Test()
dbConnection.Close();
dbConnection = null;
}
+#endif
#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
+#if !MOBILE
using System.IO;
using System.Xml;
}
}
-#endif // NET_2_0
+#endif
using System;
using System.Data;
-using System.Data.Odbc;
using System.Data.SqlClient;
+#if !MOBILE
+using System.Data.Odbc;
+#endif
using NUnit.Framework;
Assert.IsNull (da.DeleteCommand, "#3");
}
- [Test]
- public void DeleteCommand_IDbDataAdapter ()
- {
- IDbDataAdapter da = new SqlDataAdapter ();
- SqlCommand cmd1 = new SqlCommand ();
- SqlCommand cmd2 = new SqlCommand ();
-
- da.DeleteCommand = cmd1;
- Assert.AreSame (cmd1, da.DeleteCommand, "#A1");
- da.DeleteCommand = cmd2;
- Assert.AreSame (cmd2, da.DeleteCommand, "#A2");
- da.DeleteCommand = null;
- Assert.IsNull (da.DeleteCommand, "#A3");
-
- try {
- da.DeleteCommand = new OdbcCommand ();
- Assert.Fail ("#B1");
- } catch (InvalidCastException ex) {
- Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
- Assert.IsNull (ex.InnerException, "#B3");
- Assert.IsNotNull (ex.Message, "#B4");
- }
- }
-
[Test]
public void Dispose ()
{
Assert.IsNull (da.InsertCommand, "#3");
}
- [Test]
- public void InsertCommand_IDbDataAdapter ()
- {
- IDbDataAdapter da = new SqlDataAdapter ();
- SqlCommand cmd1 = new SqlCommand ();
- SqlCommand cmd2 = new SqlCommand ();
-
- da.InsertCommand = cmd1;
- Assert.AreSame (cmd1, da.InsertCommand, "#A1");
- da.InsertCommand = cmd2;
- Assert.AreSame (cmd2, da.InsertCommand, "#A2");
- da.InsertCommand = null;
- Assert.IsNull (da.InsertCommand, "#A3");
-
- try {
- da.InsertCommand = new OdbcCommand ();
- Assert.Fail ("#B1");
- } catch (InvalidCastException ex) {
- Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
- Assert.IsNull (ex.InnerException, "#B3");
- Assert.IsNotNull (ex.Message, "#B4");
- }
- }
-
[Test]
public void SelectCommand ()
{
Assert.IsNull (da.SelectCommand, "#3");
}
- [Test]
- public void SelectCommand_IDbDataAdapter ()
- {
- IDbDataAdapter da = new SqlDataAdapter ();
- SqlCommand cmd1 = new SqlCommand ();
- SqlCommand cmd2 = new SqlCommand ();
-
- da.SelectCommand = cmd1;
- Assert.AreSame (cmd1, da.SelectCommand, "#A1");
- da.SelectCommand = cmd2;
- Assert.AreSame (cmd2, da.SelectCommand, "#A2");
- da.SelectCommand = null;
- Assert.IsNull (da.SelectCommand, "#A3");
-
- try {
- da.SelectCommand = new OdbcCommand ();
- Assert.Fail ("#B1");
- } catch (InvalidCastException ex) {
- Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
- Assert.IsNull (ex.InnerException, "#B3");
- Assert.IsNotNull (ex.Message, "#B4");
- }
- }
-
-#if NET_2_0
[Test]
public void UpdateBatchSize ()
{
Assert.AreEqual ("UpdateBatchSize", ex.ParamName, "#6");
}
}
-#endif
[Test]
public void UpdateCommand ()
Assert.IsNull (da.UpdateCommand, "#3");
}
+#if !MOBILE
+ [Test]
+ public void DeleteCommand_IDbDataAdapter ()
+ {
+ IDbDataAdapter da = new SqlDataAdapter ();
+ SqlCommand cmd1 = new SqlCommand ();
+ SqlCommand cmd2 = new SqlCommand ();
+
+ da.DeleteCommand = cmd1;
+ Assert.AreSame (cmd1, da.DeleteCommand, "#A1");
+ da.DeleteCommand = cmd2;
+ Assert.AreSame (cmd2, da.DeleteCommand, "#A2");
+ da.DeleteCommand = null;
+ Assert.IsNull (da.DeleteCommand, "#A3");
+
+ try {
+ da.DeleteCommand = new OdbcCommand ();
+ Assert.Fail ("#B1");
+ } catch (InvalidCastException ex) {
+ Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
+ Assert.IsNull (ex.InnerException, "#B3");
+ Assert.IsNotNull (ex.Message, "#B4");
+ }
+ }
+
+
+ [Test]
+ public void InsertCommand_IDbDataAdapter ()
+ {
+ IDbDataAdapter da = new SqlDataAdapter ();
+ SqlCommand cmd1 = new SqlCommand ();
+ SqlCommand cmd2 = new SqlCommand ();
+
+ da.InsertCommand = cmd1;
+ Assert.AreSame (cmd1, da.InsertCommand, "#A1");
+ da.InsertCommand = cmd2;
+ Assert.AreSame (cmd2, da.InsertCommand, "#A2");
+ da.InsertCommand = null;
+ Assert.IsNull (da.InsertCommand, "#A3");
+
+ try {
+ da.InsertCommand = new OdbcCommand ();
+ Assert.Fail ("#B1");
+ } catch (InvalidCastException ex) {
+ Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
+ Assert.IsNull (ex.InnerException, "#B3");
+ Assert.IsNotNull (ex.Message, "#B4");
+ }
+ }
+
+ [Test]
+ public void SelectCommand_IDbDataAdapter ()
+ {
+ IDbDataAdapter da = new SqlDataAdapter ();
+ SqlCommand cmd1 = new SqlCommand ();
+ SqlCommand cmd2 = new SqlCommand ();
+
+ da.SelectCommand = cmd1;
+ Assert.AreSame (cmd1, da.SelectCommand, "#A1");
+ da.SelectCommand = cmd2;
+ Assert.AreSame (cmd2, da.SelectCommand, "#A2");
+ da.SelectCommand = null;
+ Assert.IsNull (da.SelectCommand, "#A3");
+
+ try {
+ da.SelectCommand = new OdbcCommand ();
+ Assert.Fail ("#B1");
+ } catch (InvalidCastException ex) {
+ Assert.AreEqual (typeof (InvalidCastException), ex.GetType (), "#B2");
+ Assert.IsNull (ex.InnerException, "#B3");
+ Assert.IsNotNull (ex.Message, "#B4");
+ }
+ }
+
[Test]
public void UpdateCommand_IDbDataAdapter ()
{
Assert.IsNotNull (ex.Message, "#B4");
}
}
+#endif
}
}
using System;
using System.Data;
-using System.Data.OleDb ;
using System.IO;
using System.Collections;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
using System;
using System.Data;
+#if !MOBILE
+using NUnit.Framework.SyntaxHelpers;
+#endif
namespace MonoTests.System.Data
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
using System;
using System.Data;
+#if !MOBILE
+using NUnit.Framework.SyntaxHelpers;
+#endif
namespace MonoTests.System.Data
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
using System;
using System.Data;
+#if !MOBILE
+using NUnit.Framework.SyntaxHelpers;
+#endif
namespace MonoTests.System.Data
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
using NUnit.Framework;\r
-using NUnit.Framework.SyntaxHelpers;\r
using System;\r
using System.Data;\r
+#if !MOBILE\r
+using NUnit.Framework.SyntaxHelpers;\r
+#endif\r
\r
namespace MonoTests.System.Data\r
{\r
[global::System.ComponentModel.ToolboxItem(true)]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
[global::System.Xml.Serialization.XmlRootAttribute("DataSet1")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
+// [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
public partial class DataSet1 : global::System.Data.DataSet {
private DataTable1DataTable tableDataTable1;
substring = TextString.Substring (0, TextString.IndexOf(EOL));
TextString = TextString.Substring (TextString.IndexOf(EOL) + EOL.Length);
// This is original DataSet.WriteXmlSchema() output
-#if NET_4_0
+#if MOBILE
+ Assert.AreEqual (" <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
+#elif NET_4_0
Assert.AreEqual (" <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
#elif NET_2_0
Assert.AreEqual (" <xs:element minOccurs=\"0\" msdata:DataType=\"System.Data.SqlTypes.SqlGuid, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" name=\"second\" type=\"xs:string\" />", substring, "test#16");
namespace MonoTests_System.Data
{
- [TestFixture] public class DataSetTest2
+ [TestFixture]
+ public class DataSetTest2
{
private DataSet m_ds = null;
private bool EventRaised = false;
//ds1.Load (reader, LoadOption.PreserveChanges, dt3, dt4);
ds1.Load (reader, LoadOption.OverwriteChanges, dt3, dt4);
- Assertion.AssertEquals ("DataSet Tables count mistmatch", ds2.Tables.Count, ds1.Tables.Count);
+ Assert.AreEqual (ds2.Tables.Count, ds1.Tables.Count, "DataSet Tables count mistmatch");
int i = 0;
foreach (DataTable dt in ds1.Tables) {
DataTable dt5 = ds2.Tables[i];
- Assertion.AssertEquals ("Table " + dt.TableName + " row count mistmatch", dt5.Rows.Count, dt.Rows.Count);
+ Assert.AreEqual (dt5.Rows.Count, dt.Rows.Count, "Table " + dt.TableName + " row count mistmatch");
int j = 0;
DataRow row1;
foreach (DataRow row in dt.Rows) {
row1 = dt5.Rows[j];
for (int k = 0; k < dt.Columns.Count; k++) {
- Assertion.AssertEquals ("DataRow " + k + " mismatch", row1[k], row[k]);
+ Assert.AreEqual (row1[k], row[k], "DataRow " + k + " mismatch");
}
j++;
}
//ds1.Load (reader, LoadOption.PreserveChanges, dt3, dt4);
ds1.Load (reader, LoadOption.OverwriteChanges, dt3, dt4);
- Assertion.AssertEquals ("DataSet Tables count mistmatch", ds2.Tables.Count, ds1.Tables.Count);
+ Assert.AreEqual (ds2.Tables.Count, ds1.Tables.Count, "DataSet Tables count mistmatch");
int i = 0;
foreach (DataTable dt in ds1.Tables) {
DataTable dt5 = ds2.Tables[i];
- Assertion.AssertEquals ("Table " + dt.TableName + " row count mistmatch", dt5.Rows.Count, dt.Rows.Count);
+ Assert.AreEqual (dt5.Rows.Count, dt.Rows.Count, "Table " + dt.TableName + " row count mistmatch");
int j = 0;
DataRow row1;
foreach (DataRow row in dt.Rows) {
row1 = dt5.Rows[j];
for (int k = 0; k < dt.Columns.Count; k++) {
- Assertion.AssertEquals ("DataRow " + k + " mismatch", row1[k], row[k]);
+ Assert.AreEqual (row1[k], row[k], "DataRow " + k + " mismatch");
}
j++;
}
Assert.AreEqual (5, n, "n");
}
-#if !TARGET_JVM
+#if !TARGET_JVM && !MONOTOUCH
[Test]
public void NFIFromBug55978 ()
{
using System;
using System.Data;
using System.Collections;
-using System.Data.Odbc;
using System.IO;
using System.Xml;
using NUnit.Framework;
string deleted = @"<DataViewSettingCollectionString><table2-1 Sort="""" RowFilter="""" RowStateFilter=""Deleted""/></DataViewSettingCollectionString>";
DataViewManager m = new DataViewManager (null);
- Assert (m.DataSet == null);
- Assert (m.DataViewSettingCollectionString == "");
+ AssertNull (m.DataSet);
+ AssertEquals ("", m.DataViewSettingCollectionString);
AssertNotNull (m.DataViewSettings);
DataSet ds = new DataSet ("ds");
m.DataSet = ds;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.CodeDom;
}
}
}
+
+#endif
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
using System;
using System.Data;
+#if !MOBILE
+using NUnit.Framework.SyntaxHelpers;
+#endif
namespace MonoTests.System.Data
{
[Test]
public void XmlLoadTest ()
{
- try {
DataSet ds = new DataSet();
ds.ReadXmlSchema ("Test/System.Data/TestReadXmlSchema1.xml");
ds.ReadXml ("Test/System.Data/TestReadXml1.xml");
- ds = null;
- } catch {
- Assert.Fail ("#1 Should not throw Exception");
- }
}
// Test for Bug#377146
+#if !MOBILE
+
using System;
using System.Runtime.Serialization;
using System.IO;
}
}
+#endif
using System.ServiceModel;
using NUnit.Framework;
using NUnit.Framework.Constraints;
+#if !MOBILE
using NUnit.Framework.SyntaxHelpers;
+#endif
namespace MonoTests.System.Runtime.Serialization
{
Assert.That (Serialize<ICollection<int>> (list), Is.EqualTo (arrayResult), "#3");
Assert.That (Serialize<IList<object>> (list),
- Is.InstanceOfType (typeof (InvalidCastException)), "#4");
+ InstanceOf (typeof (InvalidCastException)), "#4");
Assert.That (Serialize<IList<int>> (mylist), Is.EqualTo (arrayResult), "#5");
Assert.That (Serialize<IList<int>> (list.AsReadOnly ()), Is.EqualTo (arrayResult), "#6");
Assert.That (Serialize<IList<int>> (mylist), Is.EqualTo (arrayResult), "#1");
Assert.That (Serialize<List<int>> (mylist), Is.EqualTo (arrayResult), "#2");
Assert.That (Serialize<IMyList<int>> (mylist),
- Is.InstanceOfType (typeof (SerializationException)), "#3");
+ InstanceOf (typeof (SerializationException)), "#3");
Assert.That (Serialize<MyList<int>> (mylist), Is.EqualTo (arrayResult), "#4");
}
Deserialize<CustomList<int>> (arrayResult);
Assert.Fail ("#5");
} catch (Exception ex) {
- Assert.That (ex, Is.InstanceOfType (typeof (SerializationException)), "#6");
+ Assert.That (ex, InstanceOf (typeof (SerializationException)), "#6");
}
try {
Deserialize<ReadOnlyCollection<int>> (arrayResult);
Assert.Fail ("#7");
} catch (Exception ex) {
- Assert.That (ex, Is.InstanceOfType (typeof (SerializationException)), "#8");
+ Assert.That (ex, InstanceOf (typeof (SerializationException)), "#8");
}
/*
var list = new List<int> (array);
Assert.That (Serialize<int[]> (list),
- Is.InstanceOfType (typeof (InvalidCastException)), "#1");
+ InstanceOf (typeof (InvalidCastException)), "#1");
Assert.That (Serialize<object[]> (array),
- Is.InstanceOfType (typeof (InvalidCastException)), "#2");
+ InstanceOf (typeof (InvalidCastException)), "#2");
}
[Test]
public void TestCollectionDataContract ()
{
Assert.That (Serialize<MissingAddMethod<int>> (new MissingAddMethod<int> ()),
- Is.InstanceOfType (typeof (InvalidDataContractException)), "#1");
+ InstanceOf (typeof (InvalidDataContractException)), "#1");
Assert.That (Serialize<MissingEnumerable<int>> (new MissingEnumerable<int> ()),
- Is.InstanceOfType (typeof (InvalidDataContractException)), "#2");
+ InstanceOf (typeof (InvalidDataContractException)), "#2");
var array = new[] { 1, 2, 3 };
var arrayResult = (string)Serialize<int[]> (array);
var collection = new MyDataContractCollection<int> (array);
var result = Serialize<MyDataContractCollection<int>> (collection);
- Assert.That (result, Is.InstanceOfType (typeof(string)), "#3");
+ Assert.That (result, InstanceOf (typeof(string)), "#3");
Assert.That (Serialize<MyDataContractCollection<int>> (array),
- Is.InstanceOfType (typeof (SerializationException)), "#4");
+ InstanceOf (typeof (SerializationException)), "#4");
var derived = new MyDerivedDataContract<int> ();
Assert.That (Serialize<MyDataContractCollection<int>> (derived),
- Is.InstanceOfType (typeof (SerializationException)), "#5");
+ InstanceOf (typeof (SerializationException)), "#5");
try {
Deserialize<MyDataContractCollection<int>> (arrayResult);
Assert.Fail ("#6");
} catch (Exception ex) {
- Assert.That (ex, Is.InstanceOfType (typeof(SerializationException)), "#7");
+ Assert.That (ex, InstanceOf (typeof(SerializationException)), "#7");
}
var deserialized = Deserialize<MyDataContractCollection<int>> ((string)result);
- Assert.That (deserialized, Is.InstanceOfType (typeof (MyDataContractCollection<int>)), "#8");
+ Assert.That (deserialized, InstanceOf (typeof (MyDataContractCollection<int>)), "#8");
}
[Test]
{
var derived = new MyDerivedDataContract<int> ();
Assert.That (Serialize<MyDataContractCollection<int>> (derived),
- Is.InstanceOfType (typeof (SerializationException)), "#5");
+ InstanceOf (typeof (SerializationException)), "#5");
}
+ public static InstanceOfTypeConstraint InstanceOf (Type expectedType)
+ {
+ return new InstanceOfTypeConstraint (expectedType);
+ }
}
}
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+
+#if !MOBILE
+
using System;
using System.IO;
using System.Linq;
}
}
+#endif
+
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
+
using System;
using System.Collections.Generic;
}
}
+#endif
\ No newline at end of file
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+
+#if !MOBILE
+
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
}
}
}
+
+#endif
// NetDataContractSerializer. The code could be mostly common.
//
+#if !MOBILE
+
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
}
}
+
+#endif
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+
+#if !MOBILE
+
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
}
}
}
+
+#endif
using System.Text;
using System.Xml;
using NUnit.Framework;
+using NUnit.Framework.Constraints;
namespace MonoTests.System.Xml
{
int [] arr = new int [] {0, 2, 0, 6, 8, 10,};
w.WriteArray ("", "el", "", arr, 2, 3);
w.Close ();
- Assert.AreEqual (array_int32, ms.ToArray ());
+ Assert.That (ms.ToArray (), new CollectionEquivalentConstraint (array_int32));
}
// make sure that 0 is not written in shortened format.
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
+
using System;
using System.IO;
using System.Text;
}
}
}
+
+#endif
\ No newline at end of file
using System;
using System.Transactions;
using NUnit.Framework;
+using NUnit.Framework.Constraints;
namespace MonoTests.System.Transactions {
Assert.IsTrue(called, "TransactionCompleted event handler not called!");
Assert.AreEqual(TransactionStatus.Aborted, status, "TransactionStatus != Aborted");
Assert.IsNotNull(ex, "Exception not thrown");
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException is null");
- Assert.IsInstanceOfType(typeof(NotSupportedException), ex.InnerException, "Invalid inner exception thrown");
+ Assert.That (ex.InnerException, InstanceOf( typeof(NotSupportedException)), "Invalid inner exception thrown");
}
[Test]
Assert.IsNotNull(ex, "Exception not thrown");
#if MS_EXCEPTIONS_BEHAVIOR
// MS.NET will relay the exception thrown by RM instead of wrapping it on a TransactionAbortedException.
- Assert.IsInstanceOfType(typeof(NotSupportedException), ex, "Invalid exception thrown");
+ InstanceOf(typeof(NotSupportedException), ex, "Invalid exception thrown");
#else
// Mono wrapps the exception into a TransactionAbortedException.
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
- Assert.IsInstanceOfType(typeof(NotSupportedException), ex.InnerException, "Invalid type of inner exception thrown");
+ Assert.That (ex.InnerException, InstanceOf( typeof(NotSupportedException)), "Invalid inner exception thrown");
#endif
}
Assert.IsFalse(called, "TransactionCompleted event handler _was_ called!?!?!");
Assert.IsNotNull(ex, "Exception not thrown");
// MS.NET will relay the exception thrown by RM instead of wrapping it on a TransactionAbortedException.
- Assert.IsInstanceOfType(typeof(NotSupportedException), ex, "Invalid exception thrown");
+ Assert.That (ex, InstanceOf( typeof(NotSupportedException)), "Invalid exception thrown");
}
[Test]
Assert.IsTrue(called, "TransactionCompleted event handler not called!");
Assert.IsNotNull(ex, "Exception not thrown");
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException is null");
- Assert.IsInstanceOfType(typeof(NotSupportedException), ex.InnerException, "Invalid inner exception thrown");
+ Assert.That (ex.InnerException, InstanceOf( typeof(NotSupportedException)), "Invalid inner exception thrown");
Assert.AreEqual(TransactionStatus.Aborted, status, "TransactionStatus != Aborted");
}
#endregion
Assert.AreEqual(rm1.ThrowThisException, ex, "Exception does not come from the expected RM");
#else
// Mono wrapps the exception into a TransactionAbortedException.
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
Assert.AreEqual(rm1.ThrowThisException, ex.InnerException, "Exception does not come from the expected RM \n Ex: {0}", ex);
#endif
Assert.AreEqual(rm1.ThrowThisException, ex, "Exception does not come from the expected RM \n Ex: {0}", ex);
#else
// Mono wrapps the exception into a TransactionAbortedException.
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
Assert.AreEqual(rm1.ThrowThisException, ex.InnerException, "Exception does not come from the expected RM \n Ex: {0}", ex);
#endif
Assert.IsTrue(called, "TransactionCompleted event handler not called!");
Assert.IsNotNull(ex, "Exception not thrown");
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException is null");
- Assert.IsInstanceOfType(typeof(InvalidOperationException), ex.InnerException, "Invalid inner exception thrown");
+ Assert.That (ex.InnerException, InstanceOf( typeof(InvalidOperationException)), "Invalid inner exception thrown");
Assert.AreEqual(TransactionStatus.Aborted, status, "TransactionStatus != Aborted");
}
Assert.IsTrue(called, "TransactionCompleted event handler not called!");
Assert.IsNotNull(ex, "Exception not thrown");
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException is null");
- Assert.IsInstanceOfType(typeof(NotSupportedException), ex.InnerException, "Invalid inner exception thrown");
+ Assert.That (ex.InnerException, InstanceOf( typeof(NotSupportedException)), "Invalid inner exception thrown");
Assert.AreEqual(TransactionStatus.Aborted, status, "TransactionStatus != Aborted");
}
Assert.AreEqual(rm2.ThrowThisException, ex, "Exception does not come from the expected RM");
#else
// Mono wrapps the exception into a TransactionAbortedException.
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
Assert.AreEqual(rm2.ThrowThisException, ex.InnerException, "Exception does not come from the expected RM \n Ex: {0}", ex.InnerException);
#endif
Assert.AreEqual(rm1.ThrowThisException, ex, "Exception does not come from the expected RM");
#else
// Mono wrapps the exception into a TransactionAbortedException.
- Assert.IsInstanceOfType(typeof(TransactionAbortedException), ex, "Invalid type of exception thrown");
+ Assert.That (ex, InstanceOf( typeof(TransactionAbortedException)), "Invalid type of exception thrown");
Assert.IsNotNull(ex.InnerException, "InnerException not thrown");
Assert.AreEqual(rm1.ThrowThisException, ex.InnerException, "Exception does not come from the expected RM \n Ex: {0}", ex);
#endif
#endregion
+ public static InstanceOfTypeConstraint InstanceOf (Type expectedType)
+ {
+ return new InstanceOfTypeConstraint (expectedType);
+ }
}
}
[TestFixture]
public class TransactionScopeTest
{
+
[Test]
public void TransactionScopeCommit ()
{
// Copyright (C) 2007 Novell, Inc.
//
+#if !MOBILE
+
using NUnit.Framework;
using System;
[TestFixture]
public class ServiceDescriptionImporterTest
{
-#if NET_2_0
CodeNamespace GenerateCodeFromWsdl (ServiceDescription sd)
{
ServiceDescriptionImporter imp =
}
Assert.IsTrue (verified, "verified");
}
-#endif
}
}
+
+#endif
// Copyright (C) 2006 Novell, Inc.
//
+
+#if !MOBILE
using NUnit.Framework;
using System;
#endif
}
}
+
+#endif
// Copyright (C) 2006 Novell, Inc.
//
-#if NET_2_0
+#if !MOBILE
using NUnit.Framework;
// Copyright (C) 2006 Novell, Inc.
//
-#if NET_2_0
+#if !MOBILE
using NUnit.Framework;
// Copyright (C) 2008 Novell, Inc.
//
-#if NET_2_0
+#if !MOBILE
using NUnit.Framework;
//
// Copyright (C) 2007 Novell, Inc.
//
-#if NET_2_0
+#if !MOBILE
using NUnit.Framework;
using System;
//
// Copyright (C) 2007 Novell, Inc.
//
-#if NET_2_0
+#if !MOBILE
using NUnit.Framework;
using System;
using NUnit.Framework;
using System;
using System.Web.Services;
-using System.EnterpriseServices;
namespace MonoTests.System.Web.Services {
// Copyright (C) 2007 Novell, Inc.
//
+#if !MOBILE
using NUnit.Framework;
using System;
using System.Web.Services;
-using System.EnterpriseServices;
namespace MonoTests.System.Web.Services
{
}
}
}
+
+#endif
\ No newline at end of file