2023-03-23 23:54:08 +03:00
|
|
|
#nullable enable
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using ObjCRuntime;
|
|
|
|
|
|
|
|
namespace GeneratorTests {
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
[Parallelizable (ParallelScope.All)]
|
|
|
|
public class ConstructorArgumentsTests {
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetCtorValuesNullVersion ()
|
|
|
|
{
|
|
|
|
var args = new AttributeFactory.ConstructorArguments (PlatformName.iOS, "test");
|
|
|
|
var values = args.GetCtorValues ();
|
|
|
|
#if NET
|
|
|
|
Assert.AreEqual (2, values.Length, "Length");
|
|
|
|
Assert.AreEqual ((byte)PlatformName.iOS, values[0], "Platform");
|
|
|
|
Assert.AreEqual ("test", values[1], "Message");
|
|
|
|
#else
|
|
|
|
Assert.AreEqual (3, values.Length, "Length");
|
|
|
|
Assert.AreEqual ((byte) PlatformName.iOS, values [0], "Platform");
|
|
|
|
Assert.AreEqual ((byte) 0xff, values [1], "Flag");
|
|
|
|
Assert.AreEqual ("test", values [2], "Message");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetCtorValuesNullBuild ()
|
|
|
|
{
|
|
|
|
var args = new AttributeFactory.ConstructorArguments (PlatformName.iOS, 13, 0, "test");
|
|
|
|
var values = args.GetCtorValues ();
|
|
|
|
#if NET
|
|
|
|
Assert.AreEqual (4, values.Length, "Length");
|
|
|
|
Assert.AreEqual ((byte)PlatformName.iOS, values[0], "Platform");
|
|
|
|
Assert.AreEqual (13, values[1], "Major");
|
|
|
|
Assert.AreEqual (0, values[2], "Minor");
|
|
|
|
Assert.AreEqual ("test", values[3], "Message");
|
|
|
|
#else
|
|
|
|
Assert.AreEqual (5, values.Length, "Length");
|
|
|
|
Assert.AreEqual ((byte) PlatformName.iOS, values [0], "Platform");
|
|
|
|
Assert.AreEqual (13, values [1], "Major");
|
|
|
|
Assert.AreEqual (0, values [2], "Minor");
|
|
|
|
Assert.AreEqual ((byte) 0xff, values [3], "Flag");
|
|
|
|
Assert.AreEqual ("test", values [4], "Message");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetCtorValuesFullVersion ()
|
|
|
|
{
|
|
|
|
var args = new AttributeFactory.ConstructorArguments (PlatformName.iOS, 13, 0, 1, "test");
|
|
|
|
var values = args.GetCtorValues ();
|
|
|
|
#if NET
|
|
|
|
Assert.AreEqual (5, values.Length, "Length");
|
|
|
|
Assert.AreEqual ((byte)PlatformName.iOS, values[0], "Platform");
|
|
|
|
Assert.AreEqual (13, values[1], "Major");
|
|
|
|
Assert.AreEqual (0, values[2], "Minor");
|
|
|
|
Assert.AreEqual (1, values[3], "Build");
|
|
|
|
Assert.AreEqual ("test", values[4], "Message");
|
|
|
|
#else
|
|
|
|
Assert.AreEqual (6, values.Length, "Length");
|
|
|
|
Assert.AreEqual ((byte) PlatformName.iOS, values [0], "Platform");
|
|
|
|
Assert.AreEqual (13, values [1], "Major");
|
|
|
|
Assert.AreEqual (0, values [2], "Minor");
|
|
|
|
Assert.AreEqual (1, values [3], "Build");
|
|
|
|
Assert.AreEqual ((byte) 0xff, values [4], "Flag");
|
|
|
|
Assert.AreEqual ("test", values [5], "Message");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetCtorTypesNullVersion ()
|
|
|
|
{
|
|
|
|
var args = new AttributeFactory.ConstructorArguments (PlatformName.iOS, "test");
|
|
|
|
var types = args.GetCtorTypes ();
|
|
|
|
#if NET
|
|
|
|
Assert.AreEqual (2, types.Length, "Length");
|
|
|
|
Assert.AreEqual (typeof (PlatformName), types [0], "Platform");
|
|
|
|
Assert.AreEqual(typeof(string), types[1], "Message");
|
|
|
|
#else
|
|
|
|
Assert.AreEqual (3, types.Length, "Length");
|
|
|
|
Assert.AreEqual (typeof (PlatformName), types [0], "Platform");
|
|
|
|
Assert.AreEqual (typeof (PlatformArchitecture), types [1], "Arch");
|
|
|
|
Assert.AreEqual (typeof (string), types [2], "Message");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetCtorTypesNullBuild ()
|
|
|
|
{
|
|
|
|
var args = new AttributeFactory.ConstructorArguments (PlatformName.iOS, 13, 0, "test");
|
|
|
|
var types = args.GetCtorTypes ();
|
|
|
|
#if NET
|
|
|
|
Assert.AreEqual (4, types.Length, "Length");
|
|
|
|
Assert.AreEqual (typeof (PlatformName), types [0], "Platform");
|
|
|
|
Assert.AreEqual (typeof (int), types [1], "Major");
|
|
|
|
Assert.AreEqual (typeof (int), types [2], "Minor");
|
|
|
|
Assert.AreEqual(typeof(string), types[3], "Message");
|
|
|
|
#else
|
|
|
|
Assert.AreEqual (5, types.Length, "Length");
|
|
|
|
Assert.AreEqual (typeof (PlatformName), types [0], "Platform");
|
|
|
|
Assert.AreEqual (typeof (int), types [1], "Major");
|
|
|
|
Assert.AreEqual (typeof (int), types [2], "Minor");
|
|
|
|
Assert.AreEqual (typeof (PlatformArchitecture), types [3], "Arch");
|
|
|
|
Assert.AreEqual (typeof (string), types [4], "Message");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetCtorTypesFullVersion ()
|
|
|
|
{
|
|
|
|
var args = new AttributeFactory.ConstructorArguments (PlatformName.iOS, 13, 0, 1, "test");
|
|
|
|
var types = args.GetCtorTypes ();
|
|
|
|
#if NET
|
|
|
|
Assert.AreEqual (5, types.Length, "Length");
|
|
|
|
Assert.AreEqual (typeof (PlatformName), types [0], "Platform");
|
|
|
|
Assert.AreEqual (typeof (int), types [1], "Major");
|
|
|
|
Assert.AreEqual (typeof (int), types [2], "Minor");
|
|
|
|
Assert.AreEqual (typeof (int), types [3], "Build");
|
|
|
|
Assert.AreEqual(typeof(string), types[4], "Message");
|
|
|
|
#else
|
|
|
|
Assert.AreEqual (6, types.Length, "Length");
|
|
|
|
Assert.AreEqual (typeof (PlatformName), types [0], "Platform");
|
|
|
|
Assert.AreEqual (typeof (int), types [1], "Major");
|
|
|
|
Assert.AreEqual (typeof (int), types [2], "Minor");
|
|
|
|
Assert.AreEqual (typeof (int), types [3], "Build");
|
|
|
|
Assert.AreEqual (typeof (PlatformArchitecture), types [4], "Arch");
|
|
|
|
Assert.AreEqual (typeof (string), types [5], "Message");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
class TryGetArgumentsData : IEnumerable {
|
|
|
|
public IEnumerator GetEnumerator ()
|
|
|
|
{
|
|
|
|
#if NET
|
|
|
|
yield return new TestCaseData (
|
|
|
|
new object [] { (byte)13, (byte)0 },
|
|
|
|
PlatformName.iOS,
|
|
|
|
new object? [] { (byte) PlatformName.iOS, (int) (byte) 13, (int) (byte) 0, null },
|
|
|
|
new [] { typeof(PlatformName), typeof (int), typeof (int), typeof (string) }
|
|
|
|
);
|
|
|
|
|
|
|
|
yield return new TestCaseData (
|
|
|
|
new object [] { (byte)13, (byte)0 , (byte)1},
|
|
|
|
PlatformName.iOS,
|
|
|
|
new object? [] { (byte) PlatformName.iOS, (int) (byte) 13, (int) (byte) 0, (int)(byte)1,null },
|
|
|
|
new [] { typeof(PlatformName), typeof (int), typeof (int), typeof(int), typeof (string) }
|
|
|
|
);
|
|
|
|
#else
|
|
|
|
yield return new TestCaseData (
|
|
|
|
new object [] { (byte) 13, (byte) 0 },
|
|
|
|
PlatformName.iOS,
|
|
|
|
new object? [] { (byte) PlatformName.iOS, (int) (byte) 13, (int) (byte) 0, (byte) 0xff, null },
|
|
|
|
new [] { typeof (PlatformName), typeof (int), typeof (int), typeof (PlatformArchitecture), typeof (string) }
|
|
|
|
);
|
|
|
|
yield return new TestCaseData (
|
|
|
|
new object [] { (byte) 13, (byte) 0, (byte) 1 },
|
|
|
|
PlatformName.iOS,
|
|
|
|
new object? [] { (byte) PlatformName.iOS, (int) (byte) 13, (int) (byte) 0, (int) (byte) 1, (byte) 0xff, null },
|
|
|
|
new [] { typeof (PlatformName), typeof (int), typeof (int), typeof (int), typeof (PlatformArchitecture), typeof (string) }
|
|
|
|
);
|
|
|
|
yield return new TestCaseData (
|
|
|
|
new object [] { (byte) 13, (byte) 0, true },
|
|
|
|
PlatformName.iOS,
|
|
|
|
new object? [] { (byte) PlatformName.iOS, (int) (byte) 13, (int) (byte) 0, (byte) 2, null },
|
|
|
|
new [] { typeof (PlatformName), typeof (int), typeof (int), typeof (PlatformArchitecture), typeof (string) }
|
|
|
|
);
|
|
|
|
|
|
|
|
yield return new TestCaseData (
|
|
|
|
new object [] { (byte) 13, (byte) 0, (byte) 1, true },
|
|
|
|
PlatformName.iOS,
|
|
|
|
new object? [] { (byte) PlatformName.iOS, (int) (byte) 13, (int) (byte) 0, (int) (byte) 1, (byte) 2, null },
|
|
|
|
new [] { typeof (PlatformName), typeof (int), typeof (int), typeof (int), typeof (PlatformArchitecture), typeof (string) }
|
|
|
|
);
|
|
|
|
|
|
|
|
yield return new TestCaseData (
|
|
|
|
new object [] { (byte) 13, (byte) 0, (byte) 1, (byte) 2 },
|
|
|
|
PlatformName.iOS,
|
|
|
|
new object? [] { (byte) PlatformName.iOS, (int) (byte) 13, (int) (byte) 0, (int) (byte) 1, (byte) 2, null },
|
|
|
|
new [] { typeof (PlatformName), typeof (int), typeof (int), typeof (int), typeof (PlatformArchitecture), typeof (string) }
|
|
|
|
);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[TestCaseSource (typeof (TryGetArgumentsData))]
|
|
|
|
public void TryGetCtorArguments (object [] arguments, PlatformName platformName, object [] expectedValues,
|
|
|
|
Type [] expectedTypes)
|
|
|
|
{
|
|
|
|
var success = AttributeFactory.ConstructorArguments.TryGetCtorArguments (arguments, platformName,
|
|
|
|
out var actualValues, out var actualTypes);
|
|
|
|
Assert.True (success, "success");
|
[tests] Remove files from the generator tests to fix compiler warnings. (#18092)
Also fix a nullability warning.
Fixes these warnings:
"tests/generator/generator-tests.csproj" (default target) (1:7) ->
(CoreCompile target) ->
tests/generator/AttributeFactoryTests.cs(43,29): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(44,29): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(45,29): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(17,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(34,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(53,39): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(54,39): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(55,39): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(56,39): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(64,34): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(69,11): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(76,34): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(55,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(83,34): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(78,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(111,16): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(138,16): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(95,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(178,16): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(116,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.]
tests/generator/ConstructorArgumentsTests.cs(194,18): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.]
tests/generator/ConstructorArgumentsTests.cs(210,18): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.]
tests/generator/ConstructorArgumentsTests.cs(197,44): warning CS8602: Dereference of a possibly null reference.
tests/generator/ConstructorArgumentsTests.cs(201,43): warning CS8602: Dereference of a possibly null reference.
2023-04-20 08:34:30 +03:00
|
|
|
Assert.AreEqual (expectedValues!.Length, actualValues!.Length, "Values Length");
|
2023-03-23 23:54:08 +03:00
|
|
|
for (int index = 0; index < expectedValues.Length; index++) {
|
|
|
|
Assert.AreEqual (expectedValues [index], actualValues [index], $"Values [{index}]");
|
|
|
|
}
|
[tests] Remove files from the generator tests to fix compiler warnings. (#18092)
Also fix a nullability warning.
Fixes these warnings:
"tests/generator/generator-tests.csproj" (default target) (1:7) ->
(CoreCompile target) ->
tests/generator/AttributeFactoryTests.cs(43,29): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(44,29): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(45,29): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(17,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(34,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(53,39): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(54,39): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(55,39): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(56,39): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(64,34): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(69,11): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(76,34): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(55,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(83,34): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(78,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(111,16): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(138,16): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(95,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/AttributeFactoryTests.cs(178,16): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.
tests/generator/ConstructorArgumentsTests.cs(116,19): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.]
tests/generator/ConstructorArgumentsTests.cs(194,18): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.]
tests/generator/ConstructorArgumentsTests.cs(210,18): warning CS0436: The type 'AttributeFactory' in 'tests/generator/../../src/bgen/AttributeFactory.cs' conflicts with the imported type 'AttributeFactory' in 'bgen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/generator/../../src/bgen/AttributeFactory.cs'.]
tests/generator/ConstructorArgumentsTests.cs(197,44): warning CS8602: Dereference of a possibly null reference.
tests/generator/ConstructorArgumentsTests.cs(201,43): warning CS8602: Dereference of a possibly null reference.
2023-04-20 08:34:30 +03:00
|
|
|
Assert.AreEqual (expectedTypes!.Length, actualTypes!.Length, "Types Length");
|
2023-03-23 23:54:08 +03:00
|
|
|
for (int index = 0; index < expectedTypes.Length; index++) {
|
|
|
|
Assert.AreEqual (expectedTypes [index], actualTypes [index], $"Types [{index}]");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TryGetCtorArgumentsFail ()
|
|
|
|
{
|
|
|
|
var success = AttributeFactory.ConstructorArguments.TryGetCtorArguments (Array.Empty<object> (), PlatformName.iOS,
|
|
|
|
out var actualValues, out var actualTypes);
|
|
|
|
Assert.False (success, "success");
|
|
|
|
Assert.Null (actualValues, "values");
|
|
|
|
Assert.Null (actualTypes, "type");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|