Skip to content

Commit

Permalink
[tests] Use Assert.IsInstanceOf instead of Assert.IsInstanceOfType.
Browse files Browse the repository at this point in the history
The latter doesn't exist anymore in the official NUnitLite.
  • Loading branch information
rolfbjarne committed Jul 22, 2020
1 parent cb47026 commit 181650b
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 158 deletions.
42 changes: 21 additions & 21 deletions tests/monotouch-test/Foundation/DimensionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void BaseUnit ()
public void NSUnitAcceleration_BaseUnit ()
{
using (var bu = NSUnitAcceleration.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitAcceleration), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitAcceleration), bu, "type");
Assert.That ("m/s²", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -48,7 +48,7 @@ public void NSUnitAcceleration_BaseUnit ()
public void NSUnitAngle_BaseUnit ()
{
using (var bu = NSUnitAngle.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitAngle), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitAngle), bu, "type");
Assert.That ("°", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -57,7 +57,7 @@ public void NSUnitAngle_BaseUnit ()
public void NSUnitArea_BaseUnit ()
{
using (var bu = NSUnitArea.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitArea), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitArea), bu, "type");
Assert.That ("", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -66,7 +66,7 @@ public void NSUnitArea_BaseUnit ()
public void NSUnitConcentrationMass_BaseUnit ()
{
using (var bu = NSUnitConcentrationMass.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitConcentrationMass), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitConcentrationMass), bu, "type");
Assert.That ("g/L", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -75,7 +75,7 @@ public void NSUnitConcentrationMass_BaseUnit ()
public void NSUnitDispersion_BaseUnit ()
{
using (var bu = NSUnitDispersion.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitDispersion), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitDispersion), bu, "type");
Assert.That ("ppm", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -84,7 +84,7 @@ public void NSUnitDispersion_BaseUnit ()
public void NSUnitDuration_BaseUnit ()
{
using (var bu = NSUnitDuration.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitDuration), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitDuration), bu, "type");
Assert.That ("s", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -93,7 +93,7 @@ public void NSUnitDuration_BaseUnit ()
public void NSUnitElectricCharge_BaseUnit ()
{
using (var bu = NSUnitElectricCharge.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitElectricCharge), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitElectricCharge), bu, "type");
Assert.That ("C", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -102,7 +102,7 @@ public void NSUnitElectricCharge_BaseUnit ()
public void NSUnitElectricCurrent_BaseUnit ()
{
using (var bu = NSUnitElectricCurrent.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitElectricCurrent), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitElectricCurrent), bu, "type");
Assert.That ("A", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -111,7 +111,7 @@ public void NSUnitElectricCurrent_BaseUnit ()
public void NSUnitElectricPotentialDifference_BaseUnit ()
{
using (var bu = NSUnitElectricPotentialDifference.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitElectricPotentialDifference), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitElectricPotentialDifference), bu, "type");
Assert.That ("V", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -120,7 +120,7 @@ public void NSUnitElectricPotentialDifference_BaseUnit ()
public void NSUnitElectricResistance_BaseUnit ()
{
using (var bu = NSUnitElectricResistance.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitElectricResistance), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitElectricResistance), bu, "type");
Assert.That ("", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -129,7 +129,7 @@ public void NSUnitElectricResistance_BaseUnit ()
public void NSUnitEnergy_BaseUnit ()
{
using (var bu = NSUnitEnergy.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitEnergy), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitEnergy), bu, "type");
Assert.That ("J", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -138,7 +138,7 @@ public void NSUnitEnergy_BaseUnit ()
public void NSUnitFrequency_BaseUnit ()
{
using (var bu = NSUnitFrequency.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitFrequency), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitFrequency), bu, "type");
Assert.That ("Hz", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -147,7 +147,7 @@ public void NSUnitFrequency_BaseUnit ()
public void NSUnitFuelEfficiency_BaseUnit ()
{
using (var bu = NSUnitFuelEfficiency.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitFuelEfficiency), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitFuelEfficiency), bu, "type");
Assert.That ("L/100km", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -156,7 +156,7 @@ public void NSUnitFuelEfficiency_BaseUnit ()
public void NSUnitIlluminance_BaseUnit ()
{
using (var bu = NSUnitIlluminance.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitIlluminance), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitIlluminance), bu, "type");
Assert.That ("lx", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -165,7 +165,7 @@ public void NSUnitIlluminance_BaseUnit ()
public void NSUnitLength_BaseUnit ()
{
using (var bu = NSUnitLength.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitLength), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitLength), bu, "type");
Assert.That ("m", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -174,7 +174,7 @@ public void NSUnitLength_BaseUnit ()
public void NSUnitMass_BaseUnit ()
{
using (var bu = NSUnitMass.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitMass), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitMass), bu, "type");
Assert.That ("kg", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -183,7 +183,7 @@ public void NSUnitMass_BaseUnit ()
public void NSUnitPower_BaseUnit ()
{
using (var bu = NSUnitPower.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitPower), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitPower), bu, "type");
Assert.That ("W", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -192,7 +192,7 @@ public void NSUnitPower_BaseUnit ()
public void NSUnitPressure_BaseUnit ()
{
using (var bu = NSUnitPressure.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitPressure), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitPressure), bu, "type");
Assert.That ("N/m²", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -201,7 +201,7 @@ public void NSUnitPressure_BaseUnit ()
public void NSUnitSpeed_BaseUnit ()
{
using (var bu = NSUnitSpeed.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitSpeed), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitSpeed), bu, "type");
Assert.That ("m/s", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -210,7 +210,7 @@ public void NSUnitSpeed_BaseUnit ()
public void NSUnitTemperature_BaseUnit ()
{
using (var bu = NSUnitTemperature.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitTemperature), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitTemperature), bu, "type");
Assert.That ("K", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand All @@ -219,7 +219,7 @@ public void NSUnitTemperature_BaseUnit ()
public void NSUnitVolume_BaseUnit ()
{
using (var bu = NSUnitVolume.BaseUnit) {
Assert.IsInstanceOfType (typeof (NSUnitVolume), bu, "type");
Assert.IsInstanceOf (typeof (NSUnitVolume), bu, "type");
Assert.That ("L", Is.EqualTo (bu.Symbol), "Symbol");
}
}
Expand Down
26 changes: 13 additions & 13 deletions tests/monotouch-test/Foundation/UrlSessionTaskTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,28 @@ public void NSUrlSessionDownloadTaskTest ()
NSUrlSessionDownloadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateDownloadTask (ur), "Should not throw InvalidCastException");
Assert.IsNotNull (task, "task should not be null");
Assert.IsInstanceOfType (typeof (NSUrlSessionDownloadTask), task, "task should be an instance of NSUrlSessionDownloadTask");
Assert.IsInstanceOf (typeof (NSUrlSessionDownloadTask), task, "task should be an instance of NSUrlSessionDownloadTask");
}

using (var ur = new NSUrlRequest ()) {
NSUrlSessionDownloadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateDownloadTask (ur, null), "Should not throw InvalidCastException 2");
Assert.IsNotNull (task, "task should not be null 2");
Assert.IsInstanceOfType (typeof (NSUrlSessionDownloadTask), task, "task should be an instance of NSUrlSessionDownloadTask 2");
Assert.IsInstanceOf (typeof (NSUrlSessionDownloadTask), task, "task should be an instance of NSUrlSessionDownloadTask 2");
}

using (var ur = new NSUrl (NetworkResources.MicrosoftUrl)) {
NSUrlSessionDownloadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateDownloadTask (ur), "Should not throw InvalidCastException 3");
Assert.IsNotNull (task, "task should not be null 3");
Assert.IsInstanceOfType (typeof (NSUrlSessionDownloadTask), task, "task should be an instance of NSUrlSessionDownloadTask 3");
Assert.IsInstanceOf (typeof (NSUrlSessionDownloadTask), task, "task should be an instance of NSUrlSessionDownloadTask 3");
}

using (var ur = new NSUrl (NetworkResources.MicrosoftUrl)) {
NSUrlSessionDownloadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateDownloadTask (ur, null), "Should not throw InvalidCastException 4");
Assert.IsNotNull (task, "task should not be null 4");
Assert.IsInstanceOfType (typeof (NSUrlSessionDownloadTask), task, "task should be an instance of NSUrlSessionDownloadTask 4");
Assert.IsInstanceOf (typeof (NSUrlSessionDownloadTask), task, "task should be an instance of NSUrlSessionDownloadTask 4");
}
}

Expand All @@ -101,28 +101,28 @@ public void NSUrlSessionDataTaskTest ()
NSUrlSessionDataTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateDataTask (ur), "Should not throw InvalidCastException");
Assert.IsNotNull (task, "task should not be null");
Assert.IsInstanceOfType (typeof (NSUrlSessionDataTask), task, "task should be an instance of NSUrlSessionDataTask");
Assert.IsInstanceOf (typeof (NSUrlSessionDataTask), task, "task should be an instance of NSUrlSessionDataTask");
}

using (var ur = new NSUrlRequest ()) {
NSUrlSessionDataTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateDataTask (ur, null), "Should not throw InvalidCastException 2");
Assert.IsNotNull (task, "task should not be null 2");
Assert.IsInstanceOfType (typeof (NSUrlSessionDataTask), task, "task should be an instance of NSUrlSessionDataTask 2");
Assert.IsInstanceOf (typeof (NSUrlSessionDataTask), task, "task should be an instance of NSUrlSessionDataTask 2");
}

using (var ur = new NSUrl (NetworkResources.MicrosoftUrl)) {
NSUrlSessionDataTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateDataTask (ur), "Should not throw InvalidCastException 3");
Assert.IsNotNull (task, "task should not be null 3");
Assert.IsInstanceOfType (typeof (NSUrlSessionDataTask), task, "task should be an instance of NSUrlSessionDataTask 3");
Assert.IsInstanceOf (typeof (NSUrlSessionDataTask), task, "task should be an instance of NSUrlSessionDataTask 3");
}

using (var ur = new NSUrl (NetworkResources.MicrosoftUrl)) {
NSUrlSessionDataTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateDataTask (ur, null), "Should not throw InvalidCastException 4");
Assert.IsNotNull (task, "task should not be null 4");
Assert.IsInstanceOfType (typeof (NSUrlSessionDataTask), task, "task should be an instance of NSUrlSessionDataTask 4");
Assert.IsInstanceOf (typeof (NSUrlSessionDataTask), task, "task should be an instance of NSUrlSessionDataTask 4");
}
}

Expand All @@ -135,39 +135,39 @@ public void NSUrlSessionUploadTaskTest ()
NSUrlSessionUploadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateUploadTask (ur), "Should not throw InvalidCastException");
Assert.IsNotNull (task, "task should not be null");
Assert.IsInstanceOfType (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask");
Assert.IsInstanceOf (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask");
}

using (var data = NSData.FromString ("Hola"))
using (var ur = new NSUrlRequest ()) {
NSUrlSessionUploadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateUploadTask (ur, data), "Should not throw InvalidCastException 2");
Assert.IsNotNull (task, "task should not be null 2");
Assert.IsInstanceOfType (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask 2");
Assert.IsInstanceOf (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask 2");
}

using (var ur = new NSUrlRequest ())
using (var url = new NSUrl (NetworkResources.MicrosoftUrl)) {
NSUrlSessionUploadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateUploadTask (ur, url), "Should not throw InvalidCastException 3");
Assert.IsNotNull (task, "task should not be null 3");
Assert.IsInstanceOfType (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask 3");
Assert.IsInstanceOf (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask 3");
}

using (var ur = new NSUrlRequest ())
using (var url = new NSUrl (NetworkResources.MicrosoftUrl)) {
NSUrlSessionUploadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateUploadTask (ur, url, (data, response, error) => { }), "Should not throw InvalidCastException 4");
Assert.IsNotNull (task, "task should not be null 4");
Assert.IsInstanceOfType (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask 4");
Assert.IsInstanceOf (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask 4");
}

using (var ur = new NSUrlRequest ())
using (var data = NSData.FromString ("Hola")) {
NSUrlSessionUploadTask task = null;
Assert.DoesNotThrow (() => task = NSUrlSession.SharedSession.CreateUploadTask (ur, data, (d, response, error) => { }), "Should not throw InvalidCastException 5");
Assert.IsNotNull (task, "task should not be null 5");
Assert.IsInstanceOfType (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask 5");
Assert.IsInstanceOf (typeof (NSUrlSessionUploadTask), task, "task should be an instance of NSUrlSessionUploadTask 5");
}
}
}
Expand Down
Loading

0 comments on commit 181650b

Please sign in to comment.