Skip to content

Migrate Assert to new API #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions Tests/NFUnitTestTypes/UnitTestValueArrayTypess.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
Expand Down Expand Up @@ -112,63 +112,63 @@ public static void testMethod()
{
byte[] b = { 0 };
Type compareType = Type.GetType("System.Byte[]");
Assert.IsType(compareType, b, $"The type {compareType.Name} is not equal to {b.GetType().Name}");
Assert.IsInstanceOfType(b, compareType, $"The type {compareType.Name} is not equal to {b.GetType().Name}");
}
}
public class ValueArrayTestClass02
{
public static void testMethod()
{
char[] c = { 'a' };
Assert.IsType(Type.GetType("System.Char[]"), c);
Assert.IsInstanceOfType(c, Type.GetType("System.Char[]"));
}
}
public class ValueArrayTestClass03
{
public static void testMethod()
{
short[] s = { 0 };
Assert.IsType(Type.GetType("System.Int16[]"), s);
Assert.IsInstanceOfType(s, Type.GetType("System.Int16[]"));
}
}
public class ValueArrayTestClass04
{
public static void testMethod()
{
int[] i = { 0 };
Assert.IsType(Type.GetType("System.Int32[]"), i);
Assert.IsInstanceOfType(i, Type.GetType("System.Int32[]"));
}
}
public class ValueArrayTestClass05
{
public static void testMethod()
{
long[] l = { 0L };
Assert.IsType(Type.GetType("System.Int64[]"), l);
Assert.IsInstanceOfType(l, Type.GetType("System.Int64[]"));
}
}
public class ValueArrayTestClass06
{
public static void testMethod()
{
float[] f = { 0.0f };
Assert.IsType(Type.GetType("System.Single[]"), f);
Assert.IsInstanceOfType(f, Type.GetType("System.Single[]"));
}
}
public class ValueArrayTestClass07
{
public static void testMethod()
{
double[] d = { 0.0d };
Assert.IsType(Type.GetType("System.Double[]"), d);
Assert.IsInstanceOfType(d, Type.GetType("System.Double[]"));
}
}
public class ValueArrayTestClass09
{
public static void testMethod()
{
bool[] b = { true };
Assert.IsType(Type.GetType("System.Boolean[]"), b);
Assert.IsInstanceOfType(b, Type.GetType("System.Boolean[]"));
}
}

Expand All @@ -177,32 +177,33 @@ public class ValueArrayTestClass12
public static void testMethod()
{
string[] strArray = { "string" };
Assert.IsType(Type.GetType("System.String[]"), strArray);
Assert.IsInstanceOfType(strArray, Type.GetType("System.String[]"));
}
}
public class ValueArrayTestClass13
{
public static void testMethod()
{
sbyte[] sb = { 0 };
Assert.IsType(Type.GetType("System.SByte[]"), sb);
Assert.IsInstanceOfType(sb, Type.GetType("System.SByte[]"));
}
}
public class ValueArrayTestClass14
{
public static void testMethod()
{
ushort[] us = { 0 };
Assert.IsType(Type.GetType("System.UInt16[]"), us);
Assert.IsInstanceOfType(us, Type.GetType("System.UInt16[]"));
}
}
public class ValueArrayTestClass15
{
public static void testMethod()
{
uint[] ui = { 0 };
Assert.IsType(Type.GetType("System.UInt32[]"), ui);
Assert.IsInstanceOfType(ui, Type.GetType("System.UInt32[]"));
}
}

}
}
Loading