From a689eaf6f4ebf72be43c43755d84c117b03c32a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 22 Dec 2022 12:08:41 +0000 Subject: [PATCH] Update Unit Test projects (#672) ***NO_CI*** --- .../BinaryPrimitivesTests.cs | 168 +++++++++--------- .../BinaryPrimitivesUnitTests.nfproj | 26 ++- .../nano.runsettings | 3 +- .../BinaryPrimitivesUnitTests/packages.config | 4 +- .../packages.lock.json | 12 +- .../Iot.Device.Common.UnitTests.cs | 32 ++-- .../Iot.Device.Common.UnitTests.nfproj | 39 ++-- .../nano.runsettings | 3 +- .../packages.config | 14 +- .../packages.lock.json | 49 +++++ .../Iot.Device.Multiplexing.UnitTests.nfproj | 58 +++--- .../OutputSegmentTests.cs | 12 +- .../nano.runsettings | 14 -- .../packages.config | 8 +- .../packages.lock.json | 31 ++++ .../System.Device.Model.UnitTests.nfproj | 32 ++-- .../nano.runsettings | 14 -- .../packages.config | 4 +- .../packages.lock.json | 19 ++ tests/System.Drawing.Tests/ColorTests.cs | 114 ++++++------ .../System.Drawing.Tests.nfproj | 33 ++-- tests/System.Drawing.Tests/nano.runsettings | 14 -- tests/System.Drawing.Tests/packages.config | 4 +- tests/System.Drawing.Tests/packages.lock.json | 12 +- .../System.Numerics.UnitTests.nfproj | 42 ++--- tests/System.Numerics.UnitTests/app.config | 11 -- .../nano.runsettings | 14 -- .../System.Numerics.UnitTests/packages.config | 6 +- .../packages.lock.json | 25 +++ 29 files changed, 434 insertions(+), 383 deletions(-) create mode 100644 tests/Iot.Device.Common.UnitTests/packages.lock.json delete mode 100644 tests/Iot.Device.Multiplexing.UnitTests/nano.runsettings create mode 100644 tests/Iot.Device.Multiplexing.UnitTests/packages.lock.json delete mode 100644 tests/System.Device.Model.UnitTests/nano.runsettings create mode 100644 tests/System.Device.Model.UnitTests/packages.lock.json delete mode 100644 tests/System.Drawing.Tests/nano.runsettings delete mode 100644 tests/System.Numerics.UnitTests/app.config delete mode 100644 tests/System.Numerics.UnitTests/nano.runsettings create mode 100644 tests/System.Numerics.UnitTests/packages.lock.json diff --git a/tests/BinaryPrimitivesUnitTests/BinaryPrimitivesTests.cs b/tests/BinaryPrimitivesUnitTests/BinaryPrimitivesTests.cs index 3858f7fea..bb46d1774 100644 --- a/tests/BinaryPrimitivesUnitTests/BinaryPrimitivesTests.cs +++ b/tests/BinaryPrimitivesUnitTests/BinaryPrimitivesTests.cs @@ -32,12 +32,12 @@ namespace BinaryPrimitivesUnitTests uint16res = BinaryPrimitives.ReadUInt16BigEndian(uint16byte); // Assert - Assert.Equal(int16byte[0], int16Res[0]); - Assert.Equal(int16byte[1], int16Res[1]); - Assert.Equal(uint16byte[0], uint16Res[0]); - Assert.Equal(uint16byte[1], uint16Res[1]); - Assert.Equal(int16, int16res); - Assert.Equal(uint16, uint16res); + Assert.AreEqual(int16byte[0], int16Res[0]); + Assert.AreEqual(int16byte[1], int16Res[1]); + Assert.AreEqual(uint16byte[0], uint16Res[0]); + Assert.AreEqual(uint16byte[1], uint16Res[1]); + Assert.AreEqual(int16, int16res); + Assert.AreEqual(uint16, uint16res); } [TestMethod] @@ -60,12 +60,12 @@ namespace BinaryPrimitivesUnitTests uint16res = BinaryPrimitives.ReadUInt16LittleEndian(uint16byte); // Assert - Assert.Equal(int16byte[0], int16Res[0]); - Assert.Equal(int16byte[1], int16Res[1]); - Assert.Equal(uint16byte[0], uint16Res[0]); - Assert.Equal(uint16byte[1], uint16Res[1]); - Assert.Equal(int16, int16res); - Assert.Equal(uint16, uint16res); + Assert.AreEqual(int16byte[0], int16Res[0]); + Assert.AreEqual(int16byte[1], int16Res[1]); + Assert.AreEqual(uint16byte[0], uint16Res[0]); + Assert.AreEqual(uint16byte[1], uint16Res[1]); + Assert.AreEqual(int16, int16res); + Assert.AreEqual(uint16, uint16res); } [TestMethod] @@ -88,16 +88,16 @@ namespace BinaryPrimitivesUnitTests uint32res = BinaryPrimitives.ReadUInt32BigEndian(uint32byte); // Assert - Assert.Equal(int32byte[0], intRes[0]); - Assert.Equal(int32byte[1], intRes[1]); - Assert.Equal(int32byte[2], intRes[2]); - Assert.Equal(int32byte[3], intRes[3]); - Assert.Equal(uint32byte[0], uint32Res[0]); - Assert.Equal(uint32byte[1], uint32Res[1]); - Assert.Equal(uint32byte[2], uint32Res[2]); - Assert.Equal(uint32byte[3], uint32Res[3]); - Assert.Equal(int32, int32res); - Assert.Equal(uint32, uint32res); + Assert.AreEqual(int32byte[0], intRes[0]); + Assert.AreEqual(int32byte[1], intRes[1]); + Assert.AreEqual(int32byte[2], intRes[2]); + Assert.AreEqual(int32byte[3], intRes[3]); + Assert.AreEqual(uint32byte[0], uint32Res[0]); + Assert.AreEqual(uint32byte[1], uint32Res[1]); + Assert.AreEqual(uint32byte[2], uint32Res[2]); + Assert.AreEqual(uint32byte[3], uint32Res[3]); + Assert.AreEqual(int32, int32res); + Assert.AreEqual(uint32, uint32res); } [TestMethod] @@ -120,16 +120,16 @@ namespace BinaryPrimitivesUnitTests uint32res = BinaryPrimitives.ReadUInt32LittleEndian(uint32byte); // Assert - Assert.Equal(int32byte[0], intRes[0]); - Assert.Equal(int32byte[1], intRes[1]); - Assert.Equal(int32byte[2], intRes[2]); - Assert.Equal(int32byte[3], intRes[3]); - Assert.Equal(uint32byte[0], uint32Res[0]); - Assert.Equal(uint32byte[1], uint32Res[1]); - Assert.Equal(uint32byte[2], uint32Res[2]); - Assert.Equal(uint32byte[3], uint32Res[3]); - Assert.Equal(int32, int32res); - Assert.Equal(uint32, uint32res); + Assert.AreEqual(int32byte[0], intRes[0]); + Assert.AreEqual(int32byte[1], intRes[1]); + Assert.AreEqual(int32byte[2], intRes[2]); + Assert.AreEqual(int32byte[3], intRes[3]); + Assert.AreEqual(uint32byte[0], uint32Res[0]); + Assert.AreEqual(uint32byte[1], uint32Res[1]); + Assert.AreEqual(uint32byte[2], uint32Res[2]); + Assert.AreEqual(uint32byte[3], uint32Res[3]); + Assert.AreEqual(int32, int32res); + Assert.AreEqual(uint32, uint32res); } [TestMethod] @@ -152,24 +152,24 @@ namespace BinaryPrimitivesUnitTests uint64res = BinaryPrimitives.ReadUInt64BigEndian(uint64byte); // Assert - Assert.Equal(int64byte[0], int64Res[0]); - Assert.Equal(int64byte[1], int64Res[1]); - Assert.Equal(int64byte[2], int64Res[2]); - Assert.Equal(int64byte[3], int64Res[3]); - Assert.Equal(int64byte[4], int64Res[4]); - Assert.Equal(int64byte[5], int64Res[5]); - Assert.Equal(int64byte[6], int64Res[6]); - Assert.Equal(int64byte[7], int64Res[7]); - Assert.Equal(uint64byte[0], uint64Res[0]); - Assert.Equal(uint64byte[1], uint64Res[1]); - Assert.Equal(uint64byte[2], uint64Res[2]); - Assert.Equal(uint64byte[3], uint64Res[3]); - Assert.Equal(uint64byte[4], uint64Res[4]); - Assert.Equal(uint64byte[5], uint64Res[5]); - Assert.Equal(uint64byte[6], uint64Res[6]); - Assert.Equal(uint64byte[7], uint64Res[7]); - Assert.Equal(int64, int64res); - Assert.Equal(uint64, uint64res); + Assert.AreEqual(int64byte[0], int64Res[0]); + Assert.AreEqual(int64byte[1], int64Res[1]); + Assert.AreEqual(int64byte[2], int64Res[2]); + Assert.AreEqual(int64byte[3], int64Res[3]); + Assert.AreEqual(int64byte[4], int64Res[4]); + Assert.AreEqual(int64byte[5], int64Res[5]); + Assert.AreEqual(int64byte[6], int64Res[6]); + Assert.AreEqual(int64byte[7], int64Res[7]); + Assert.AreEqual(uint64byte[0], uint64Res[0]); + Assert.AreEqual(uint64byte[1], uint64Res[1]); + Assert.AreEqual(uint64byte[2], uint64Res[2]); + Assert.AreEqual(uint64byte[3], uint64Res[3]); + Assert.AreEqual(uint64byte[4], uint64Res[4]); + Assert.AreEqual(uint64byte[5], uint64Res[5]); + Assert.AreEqual(uint64byte[6], uint64Res[6]); + Assert.AreEqual(uint64byte[7], uint64Res[7]); + Assert.AreEqual(int64, int64res); + Assert.AreEqual(uint64, uint64res); } [TestMethod] @@ -192,36 +192,36 @@ namespace BinaryPrimitivesUnitTests uint64res = BinaryPrimitives.ReadUInt64LittleEndian(uint64byte); // Assert - Assert.Equal(int64byte[0], int64Res[0]); - Assert.Equal(int64byte[1], int64Res[1]); - Assert.Equal(int64byte[2], int64Res[2]); - Assert.Equal(int64byte[3], int64Res[3]); - Assert.Equal(int64byte[4], int64Res[4]); - Assert.Equal(int64byte[5], int64Res[5]); - Assert.Equal(int64byte[6], int64Res[6]); - Assert.Equal(int64byte[7], int64Res[7]); - Assert.Equal(uint64byte[0], uint64Res[0]); - Assert.Equal(uint64byte[1], uint64Res[1]); - Assert.Equal(uint64byte[2], uint64Res[2]); - Assert.Equal(uint64byte[3], uint64Res[3]); - Assert.Equal(uint64byte[4], uint64Res[4]); - Assert.Equal(uint64byte[5], uint64Res[5]); - Assert.Equal(uint64byte[6], uint64Res[6]); - Assert.Equal(uint64byte[7], uint64Res[7]); - Assert.Equal(int64, int64res); - Assert.Equal(uint64, uint64res); + Assert.AreEqual(int64byte[0], int64Res[0]); + Assert.AreEqual(int64byte[1], int64Res[1]); + Assert.AreEqual(int64byte[2], int64Res[2]); + Assert.AreEqual(int64byte[3], int64Res[3]); + Assert.AreEqual(int64byte[4], int64Res[4]); + Assert.AreEqual(int64byte[5], int64Res[5]); + Assert.AreEqual(int64byte[6], int64Res[6]); + Assert.AreEqual(int64byte[7], int64Res[7]); + Assert.AreEqual(uint64byte[0], uint64Res[0]); + Assert.AreEqual(uint64byte[1], uint64Res[1]); + Assert.AreEqual(uint64byte[2], uint64Res[2]); + Assert.AreEqual(uint64byte[3], uint64Res[3]); + Assert.AreEqual(uint64byte[4], uint64Res[4]); + Assert.AreEqual(uint64byte[5], uint64Res[5]); + Assert.AreEqual(uint64byte[6], uint64Res[6]); + Assert.AreEqual(uint64byte[7], uint64Res[7]); + Assert.AreEqual(int64, int64res); + Assert.AreEqual(uint64, uint64res); } [TestMethod] public void TestExceptions() { - Assert.Throws(typeof(ArgumentOutOfRangeException), () => + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { SpanByte toosmall = new byte[3]; BinaryPrimitives.WriteInt32LittleEndian(toosmall, 42); }); - Assert.Throws(typeof(ArgumentOutOfRangeException), () => + Assert.ThrowsException(typeof(ArgumentOutOfRangeException), () => { SpanByte toosmall = new byte[1]; BinaryPrimitives.WriteInt16LittleEndian(toosmall, 42); @@ -246,13 +246,13 @@ namespace BinaryPrimitivesUnitTests // floatValueFromBitConverter = BitConverter.IsLittleEndian ? BitConverter.ToSingle(new byte[] { floatValueInBe[3], floatValueInBe[2], floatValueInBe[1], floatValueInBe[0] }, 0) : BitConverter.ToSingle(floatValueInBe, 0); // // Assert - // Assert.Equal(floatValueInBe[0], floatToBytes[0]); - // Assert.Equal(floatValueInBe[1], floatToBytes[1]); - // Assert.Equal(floatValueInBe[2], floatToBytes[2]); - // Assert.Equal(floatValueInBe[3], floatToBytes[3]); - // Assert.Equal(floatValue, floatFromBytes); - // Assert.Equal(floatValue, floatValueFromBitConverter); - // Assert.Equal(floatValue, doubleFromBytes, "This assert fails when the CLR didn't properly convert the uint into a float"); + // Assert.AreEqual(floatValueInBe[0], floatToBytes[0]); + // Assert.AreEqual(floatValueInBe[1], floatToBytes[1]); + // Assert.AreEqual(floatValueInBe[2], floatToBytes[2]); + // Assert.AreEqual(floatValueInBe[3], floatToBytes[3]); + // Assert.AreEqual(floatValue, floatFromBytes); + // Assert.AreEqual(floatValue, floatValueFromBitConverter); + // Assert.AreEqual(floatValue, doubleFromBytes, "This assert fails when the CLR didn't properly convert the uint into a float"); //} //[TestMethod] @@ -273,13 +273,13 @@ namespace BinaryPrimitivesUnitTests // floatValueFromBitConverter = BitConverter.IsLittleEndian ? BitConverter.ToSingle(floatValueInLe, 0) : BitConverter.ToSingle(new byte[] { floatValueInLe[3], floatValueInLe[2], floatValueInLe[1], floatValueInLe[0] }, 0); // // Assert - // Assert.Equal(floatValueInLe[0], floatToBytes[0]); - // Assert.Equal(floatValueInLe[1], floatToBytes[1]); - // Assert.Equal(floatValueInLe[2], floatToBytes[2]); - // Assert.Equal(floatValueInLe[3], floatToBytes[3]); - // Assert.Equal(floatValue, floatFromBytes); - // Assert.Equal(floatValue, floatValueFromBitConverter); - // Assert.Equal(floatValue, doubleFromBytes, "This assert fails when the CLR didn't properly convert the uint into a float"); + // Assert.AreEqual(floatValueInLe[0], floatToBytes[0]); + // Assert.AreEqual(floatValueInLe[1], floatToBytes[1]); + // Assert.AreEqual(floatValueInLe[2], floatToBytes[2]); + // Assert.AreEqual(floatValueInLe[3], floatToBytes[3]); + // Assert.AreEqual(floatValue, floatFromBytes); + // Assert.AreEqual(floatValue, floatValueFromBitConverter); + // Assert.AreEqual(floatValue, doubleFromBytes, "This assert fails when the CLR didn't properly convert the uint into a float"); //} } } diff --git a/tests/BinaryPrimitivesUnitTests/BinaryPrimitivesUnitTests.nfproj b/tests/BinaryPrimitivesUnitTests/BinaryPrimitivesUnitTests.nfproj index ad5d155b5..a1c316f1e 100644 --- a/tests/BinaryPrimitivesUnitTests/BinaryPrimitivesUnitTests.nfproj +++ b/tests/BinaryPrimitivesUnitTests/BinaryPrimitivesUnitTests.nfproj @@ -21,6 +21,8 @@ true UnitTest v1.0 + true + true @@ -31,20 +33,14 @@ - - ..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.CoreLibrary.1.10.5\lib\mscorlib.dll - True - True + + ..\..\src\BinaryPrimitives\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll - - ..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.1.0.154\lib\nanoFramework.TestFramework.dll - True - True + + ..\..\src\BinaryPrimitives\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll - - ..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.1.0.154\lib\nanoFramework.UnitTestLauncher.exe - True - True + + ..\..\src\BinaryPrimitives\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe @@ -52,12 +48,12 @@ - + - + @@ -67,6 +63,6 @@ Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - + \ No newline at end of file diff --git a/tests/BinaryPrimitivesUnitTests/nano.runsettings b/tests/BinaryPrimitivesUnitTests/nano.runsettings index fa881e3a2..e82b99e2a 100644 --- a/tests/BinaryPrimitivesUnitTests/nano.runsettings +++ b/tests/BinaryPrimitivesUnitTests/nano.runsettings @@ -5,7 +5,8 @@ 1 .\TestResults 120000 - Framework40 + net48 + x64 None diff --git a/tests/BinaryPrimitivesUnitTests/packages.config b/tests/BinaryPrimitivesUnitTests/packages.config index 820f33b01..482523c7a 100644 --- a/tests/BinaryPrimitivesUnitTests/packages.config +++ b/tests/BinaryPrimitivesUnitTests/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/tests/BinaryPrimitivesUnitTests/packages.lock.json b/tests/BinaryPrimitivesUnitTests/packages.lock.json index 53652e0bc..3322b791c 100644 --- a/tests/BinaryPrimitivesUnitTests/packages.lock.json +++ b/tests/BinaryPrimitivesUnitTests/packages.lock.json @@ -4,15 +4,15 @@ ".NETnanoFramework,Version=v1.0": { "nanoFramework.CoreLibrary": { "type": "Direct", - "requested": "[1.10.5, 1.10.5]", - "resolved": "1.10.5", - "contentHash": "jBqzT/jcEQrbQA4E7ybHE65yF6PLOI3W9nxIr5X0D3PyaDYKdg/CURR33og6mK/wp6vHppzZv1nO+4xe9G97qA==" + "requested": "[1.12.0, 1.12.0]", + "resolved": "1.12.0", + "contentHash": "qQrFNXmJiStMC4VXk5cVMOJp23/qlT9FW5i9i+igwQVwraQTtvpkam8yK1hj992jqrbjoCIFZP4Hw9E8H0pB7w==" }, "nanoFramework.TestFramework": { "type": "Direct", - "requested": "[1.0.154, 1.0.154]", - "resolved": "1.0.154", - "contentHash": "6gffUZXYvQReqff6nDflTlYViyqbZURqls1xvUoeJPE/ZDP3ZWIZHy4a63tMQL7v4k6pBIsFIOFLUOsrkn3dkg==" + "requested": "[2.1.53, 2.1.53]", + "resolved": "2.1.53", + "contentHash": "Qr070ITYv5XZ6E54+bDhFEOaCOcrx/oSOUK/uWYnQrCLTH9Tanf/fhEnWOViMk8nOiuXsPtY00Aen+57lrVsFg==" } } } diff --git a/tests/Iot.Device.Common.UnitTests/Iot.Device.Common.UnitTests.cs b/tests/Iot.Device.Common.UnitTests/Iot.Device.Common.UnitTests.cs index b000040a4..1e96e6d16 100644 --- a/tests/Iot.Device.Common.UnitTests/Iot.Device.Common.UnitTests.cs +++ b/tests/Iot.Device.Common.UnitTests/Iot.Device.Common.UnitTests.cs @@ -33,7 +33,7 @@ namespace Iot.Device.Common.Tests public void HeatIndexIsCalculatedCorrectly(double expected, double celsius, double relativeHumidity) { Temperature heatIndex = WeatherHelper.CalculateHeatIndex(Temperature.FromDegreesCelsius(celsius), RelativeHumidity.FromPercent(relativeHumidity)); - Assert.Equal(expected, Math.Round(heatIndex.DegreesCelsius)); + Assert.AreEqual(expected, Math.Round(heatIndex.DegreesCelsius)); } [TestMethod] @@ -56,7 +56,7 @@ namespace Iot.Device.Common.Tests public void SaturatedVaporPressureOverWater(double expected, double celsius) { Pressure saturatedVaporPressure = WeatherHelper.CalculateSaturatedVaporPressureOverWater(Temperature.FromDegreesCelsius(celsius)); - Assert.Equal((int)(expected * 10), (int)(saturatedVaporPressure.Pascals * 10)); + Assert.AreEqual((int)(expected * 10), (int)(saturatedVaporPressure.Pascals * 10)); } [TestMethod] @@ -77,7 +77,7 @@ namespace Iot.Device.Common.Tests public void SaturatedVaporPressureOverIce(double expected, double celsius) { Pressure saturatedVaporPressure = WeatherHelper.CalculateSaturatedVaporPressureOverIce(Temperature.FromDegreesCelsius(celsius)); - Assert.Equal((int)(expected * 10), (int)(saturatedVaporPressure.Pascals * 10)); + Assert.AreEqual((int)(expected * 10), (int)(saturatedVaporPressure.Pascals * 10)); } [TestMethod] @@ -95,7 +95,7 @@ namespace Iot.Device.Common.Tests public void ActualVaporPressureIsCalculatedCorrectly(double expected, double celsius, double relativeHumidity) { Pressure actualVaporPressure = WeatherHelper.CalculateActualVaporPressure(Temperature.FromDegreesCelsius(celsius), RelativeHumidity.FromPercent(relativeHumidity)); - Assert.Equal(expected, Math.Round(actualVaporPressure.Pascals)); + Assert.AreEqual(expected, Math.Round(actualVaporPressure.Pascals)); } [TestMethod] @@ -114,7 +114,7 @@ namespace Iot.Device.Common.Tests public void DewPointIsCalculatedCorrectly(double expected, double fahrenheit, double relativeHumidity) { Temperature dewPoint = WeatherHelper.CalculateDewPoint(Temperature.FromDegreesFahrenheit(fahrenheit), RelativeHumidity.FromPercent(relativeHumidity)); - Assert.Equal(Math.Round(expected * 100), Math.Round(dewPoint.DegreesFahrenheit * 100)); + Assert.AreEqual(Math.Round(expected * 100), Math.Round(dewPoint.DegreesFahrenheit * 100)); } // RTODO: uncomment once the Density UnitsNet will be there @@ -133,7 +133,7 @@ namespace Iot.Device.Common.Tests //public void AbsoluteHumidityIsCalculatedCorrectly(double expected, double fahrenheit, double relativeHumidity) //{ // Density absoluteHumidity = WeatherHelper.CalculateAbsoluteHumidity(Temperature.FromDegreesFahrenheit(fahrenheit), RelativeHumidity.FromPercent(relativeHumidity)); - // Assert.Equal(expected, absoluteHumidity.GramsPerCubicMeter, 0); + // Assert.AreEqual(expected, absoluteHumidity.GramsPerCubicMeter, 0); //} [TestMethod] @@ -151,7 +151,7 @@ namespace Iot.Device.Common.Tests public void AltitudeIsCalculatedCorrectlyAtMslpAndDefaultTemp(double expected, double hpa) { Length altitude = WeatherHelper.CalculateAltitude(Pressure.FromHectopascals(hpa)); - Assert.Equal(expected * 100, Math.Round(altitude.Meters * 100)); + Assert.AreEqual(expected * 100, Math.Round(altitude.Meters * 100)); } [TestMethod] @@ -169,7 +169,7 @@ namespace Iot.Device.Common.Tests public void AltitudeIsCalculatedCorrectlyAtDefaultTemp(double expected, double hpa, double seaLevelHpa) { Length altitude = WeatherHelper.CalculateAltitude(Pressure.FromHectopascals(hpa), Pressure.FromHectopascals(seaLevelHpa)); - Assert.Equal(expected * 100, Math.Round(altitude.Meters * 100)); + Assert.AreEqual(expected * 100, Math.Round(altitude.Meters * 100)); } [TestMethod] @@ -187,7 +187,7 @@ namespace Iot.Device.Common.Tests public void AltitudeIsCalculatedCorrectly(double expected, double hpa, double seaLevelHpa, double celsius) { Length altitude = WeatherHelper.CalculateAltitude(Pressure.FromHectopascals(hpa), Pressure.FromHectopascals(seaLevelHpa), Temperature.FromDegreesCelsius(celsius)); - Assert.Equal(expected * 100, Math.Round(altitude.Meters * 100)); + Assert.AreEqual(expected * 100, Math.Round(altitude.Meters * 100)); } [TestMethod] @@ -205,7 +205,7 @@ namespace Iot.Device.Common.Tests public void SeaLevelPressureIsCalculatedCorrectly(double expected, double pressure, double altitude, double celsius) { Pressure seaLevelPressure = WeatherHelper.CalculateSeaLevelPressure(Pressure.FromHectopascals(pressure), Length.FromMeters(altitude), Temperature.FromDegreesCelsius(celsius)); - Assert.Equal(expected * 100, Math.Round(seaLevelPressure.Hectopascals * 100)); + Assert.AreEqual(expected * 100, Math.Round(seaLevelPressure.Hectopascals * 100)); } [TestMethod] @@ -223,7 +223,7 @@ namespace Iot.Device.Common.Tests public void PressureIsCalculatedCorrectly(double expected, double seaLevelPressure, double altitude, double celsius) { Pressure pressure = WeatherHelper.CalculatePressure(Pressure.FromHectopascals(seaLevelPressure), Length.FromMeters(altitude), Temperature.FromDegreesCelsius(celsius)); - Assert.Equal(expected * 100, Math.Round(pressure.Hectopascals * 100)); + Assert.AreEqual(expected * 100, Math.Round(pressure.Hectopascals * 100)); } [TestMethod] @@ -241,7 +241,7 @@ namespace Iot.Device.Common.Tests public void TemperatureIsCalculatedCorrectly(double expected, double pressure, double seaLevelPressure, double altitude) { Temperature temperature = WeatherHelper.CalculateTemperature(Pressure.FromHectopascals(pressure), Pressure.FromHectopascals(seaLevelPressure), Length.FromMeters(altitude)); - Assert.Equal(expected, Math.Round(temperature.DegreesCelsius)); + Assert.AreEqual(expected, Math.Round(temperature.DegreesCelsius)); } [TestMethod] @@ -270,7 +270,7 @@ namespace Iot.Device.Common.Tests { Pressure result = WeatherHelper.CalculateBarometricPressure(Pressure.FromHectopascals(measuredValue), Temperature.FromDegreesCelsius(temperature), Length.FromMeters(altitude)); - Assert.Equal((long)(Math.Round(expected * 100)), (long)(Math.Round(result.Hectopascals * 100))); + Assert.AreEqual((long)(Math.Round(expected * 100)), (long)(Math.Round(result.Hectopascals * 100))); } [TestMethod] @@ -294,7 +294,7 @@ namespace Iot.Device.Common.Tests { Pressure result = WeatherHelper.CalculateBarometricPressure(Pressure.FromHectopascals(measuredValue), Temperature.FromDegreesCelsius(temperature), Length.FromMeters(altitude), RelativeHumidity.FromPercent(relativeHumidity)); - Assert.Equal((long)Math.Round(expected * 100), (long)Math.Round(result.Hectopascals * 100)); + Assert.AreEqual((long)Math.Round(expected * 100), (long)Math.Round(result.Hectopascals * 100)); } // TODO: uncomment once Dentisity will be added to UnitsNet @@ -309,14 +309,14 @@ namespace Iot.Device.Common.Tests ////[Theory] ////[InlineData(20, 40.2, 20, 40.2)] ////[InlineData(30, 40.2, 20, 70.569)] - ////[InlineData(27.8, 38.1, 20.0, 59.317)] // in data from BMP280 (in case), thermometer 1 meter away shows 20.0°, 57% + ////[InlineData(27.8, 38.1, 20.0, 59.317)] // in data from BMP280 (in case), thermometer 1 meter away shows 20.0�, 57% //public void GetRelativeHumidityFromActualAirTemperature(double inTemp, double inHumidity, double outTemp, double outHumidityExpected) //{ // RelativeHumidity result = WeatherHelper.GetRelativeHumidityFromActualAirTemperature( // Temperature.FromDegreesCelsius(inTemp), // RelativeHumidity.FromPercent(inHumidity), Temperature.FromDegreesCelsius(outTemp)); - // Assert.Equal((long)(outHumidityExpected * 1000), (long)(result.Percent * 1000)); + // Assert.AreEqual((long)(outHumidityExpected * 1000), (long)(result.Percent * 1000)); //} } } diff --git a/tests/Iot.Device.Common.UnitTests/Iot.Device.Common.UnitTests.nfproj b/tests/Iot.Device.Common.UnitTests/Iot.Device.Common.UnitTests.nfproj index e63077e16..3141fc4b0 100644 --- a/tests/Iot.Device.Common.UnitTests/Iot.Device.Common.UnitTests.nfproj +++ b/tests/Iot.Device.Common.UnitTests/Iot.Device.Common.UnitTests.nfproj @@ -21,6 +21,8 @@ true UnitTest v1.0 + true + true @@ -31,41 +33,55 @@ + + ..\..\src\Iot.Device.Common\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll + ..\..\src\Iot.Device.Common\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll True True - - ..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.1.0.121\lib\nanoFramework.TestFramework.dll - True - True + + ..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll - - ..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.1.0.121\lib\nanoFramework.UnitTestLauncher.exe - True - True + + ..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe + + + ..\..\src\Iot.Device.Common\packages\nanoFramework.System.Math.1.5.18\lib\System.Math.dll ..\..\src\Iot.Device.Common\packages\nanoFramework.System.Math.1.4.1\lib\System.Math.dll True True + + ..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Length.4.148.0\lib\UnitsNet.Length.dll + ..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Length.4.101.0\lib\UnitsNet.Length.dll True True + + ..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Pressure.4.148.0\lib\UnitsNet.Pressure.dll + ..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Pressure.4.101.0\lib\UnitsNet.Pressure.dll True True + + ..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.RelativeHumidity.4.148.0\lib\UnitsNet.RelativeHumidity.dll + ..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.RelativeHumidity.4.101.0\lib\UnitsNet.RelativeHumidity.dll True True + + ..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Temperature.4.148.0\lib\UnitsNet.Temperature.dll + ..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Temperature.4.101.0\lib\UnitsNet.Temperature.dll True @@ -76,10 +92,13 @@ + + + - + @@ -89,6 +108,6 @@ Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - + \ No newline at end of file diff --git a/tests/Iot.Device.Common.UnitTests/nano.runsettings b/tests/Iot.Device.Common.UnitTests/nano.runsettings index fa881e3a2..e82b99e2a 100644 --- a/tests/Iot.Device.Common.UnitTests/nano.runsettings +++ b/tests/Iot.Device.Common.UnitTests/nano.runsettings @@ -5,7 +5,8 @@ 1 .\TestResults 120000 - Framework40 + net48 + x64 None diff --git a/tests/Iot.Device.Common.UnitTests/packages.config b/tests/Iot.Device.Common.UnitTests/packages.config index fe1de9634..2b11cf4ff 100644 --- a/tests/Iot.Device.Common.UnitTests/packages.config +++ b/tests/Iot.Device.Common.UnitTests/packages.config @@ -1,10 +1,10 @@  - - - - - - - + + + + + + + \ No newline at end of file diff --git a/tests/Iot.Device.Common.UnitTests/packages.lock.json b/tests/Iot.Device.Common.UnitTests/packages.lock.json new file mode 100644 index 000000000..6048b0b7c --- /dev/null +++ b/tests/Iot.Device.Common.UnitTests/packages.lock.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "dependencies": { + ".NETnanoFramework,Version=v1.0": { + "nanoFramework.CoreLibrary": { + "type": "Direct", + "requested": "[1.12.0, 1.12.0]", + "resolved": "1.12.0", + "contentHash": "qQrFNXmJiStMC4VXk5cVMOJp23/qlT9FW5i9i+igwQVwraQTtvpkam8yK1hj992jqrbjoCIFZP4Hw9E8H0pB7w==" + }, + "nanoFramework.System.Math": { + "type": "Direct", + "requested": "[1.5.18, 1.5.18]", + "resolved": "1.5.18", + "contentHash": "xsqy3+1gblbeItzVuwDeJlFezy5N8V7CHPATsW1941kZiCNqv0cgcjmurFHSvjkQ3JZUPj5y7dLdcWtusds18Q==" + }, + "nanoFramework.TestFramework": { + "type": "Direct", + "requested": "[2.1.53, 2.1.53]", + "resolved": "2.1.53", + "contentHash": "Qr070ITYv5XZ6E54+bDhFEOaCOcrx/oSOUK/uWYnQrCLTH9Tanf/fhEnWOViMk8nOiuXsPtY00Aen+57lrVsFg==" + }, + "UnitsNet.nanoFramework.Length": { + "type": "Direct", + "requested": "[4.148.0, 4.148.0]", + "resolved": "4.148.0", + "contentHash": "UcHkjhBQG6/x2uHjIZwmoePHqmmSEQnOc2BCKiuY+z6Q21onUHd52+C6zW5ZkG5w7wNKPX9R9rhb7+xSrqUkeg==" + }, + "UnitsNet.nanoFramework.Pressure": { + "type": "Direct", + "requested": "[4.148.0, 4.148.0]", + "resolved": "4.148.0", + "contentHash": "BJiHiyopncDAD7IaFeQUQYv4bpItME394d0ck8sAxemOw2Qx7Uz27HjQ+B3mOaMSRLTcw0XrOwdYQhBynt7GPw==" + }, + "UnitsNet.nanoFramework.RelativeHumidity": { + "type": "Direct", + "requested": "[4.148.0, 4.148.0]", + "resolved": "4.148.0", + "contentHash": "9wWMmbKCYhVEu4V/ISJLkeAv2uqrIqPc8X9Us64oUAUYbmPrYKxEFBgkWVhNj8MUJomYG7H2TFMrYZTy0fXhtg==" + }, + "UnitsNet.nanoFramework.Temperature": { + "type": "Direct", + "requested": "[4.148.0, 4.148.0]", + "resolved": "4.148.0", + "contentHash": "Govk4JMC9t6ZgjPtEcE2lTQsK2COds8AK8I9Zm0wx1tpCk7XPglnPiq+ofDRrkLUCrMAfXxm9Cf3+/VqJXnW0Q==" + } + } + } +} \ No newline at end of file diff --git a/tests/Iot.Device.Multiplexing.UnitTests/Iot.Device.Multiplexing.UnitTests.nfproj b/tests/Iot.Device.Multiplexing.UnitTests/Iot.Device.Multiplexing.UnitTests.nfproj index e77a556e6..21eacca9a 100644 --- a/tests/Iot.Device.Multiplexing.UnitTests/Iot.Device.Multiplexing.UnitTests.nfproj +++ b/tests/Iot.Device.Multiplexing.UnitTests/Iot.Device.Multiplexing.UnitTests.nfproj @@ -21,51 +21,43 @@ true UnitTest v1.0 + true + true - - $(MSBuildProjectDirectory)\nano.runsettings - - - + + ..\..\devices\Multiplexing\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll + + + ..\..\devices\Multiplexing\packages\nanoFramework.Runtime.Events.1.11.1\lib\nanoFramework.Runtime.Events.dll + + + ..\..\devices\Multiplexing\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll + + + ..\..\devices\Multiplexing\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe + + + ..\..\devices\Multiplexing\packages\nanoFramework.System.Device.Gpio.1.1.22\lib\System.Device.Gpio.dll + + + - - ..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll - True - True - - - ..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.Runtime.Events.1.9.0-preview.26\lib\nanoFramework.Runtime.Events.dll - True - True - - - ..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.TestFramework.dll - True - True - - - ..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.UnitTestLauncher.exe - True - True - - - ..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.System.Device.Gpio.1.0.0-preview.40\lib\System.Device.Gpio.dll - True - True - + + + + - - + @@ -75,6 +67,6 @@ Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - + \ No newline at end of file diff --git a/tests/Iot.Device.Multiplexing.UnitTests/OutputSegmentTests.cs b/tests/Iot.Device.Multiplexing.UnitTests/OutputSegmentTests.cs index 7df01e06a..6cb81dc7c 100644 --- a/tests/Iot.Device.Multiplexing.UnitTests/OutputSegmentTests.cs +++ b/tests/Iot.Device.Multiplexing.UnitTests/OutputSegmentTests.cs @@ -16,7 +16,7 @@ namespace Iot.Device.Multiplexing public void SegmentLength() { VirtualOutputSegment segment = new(2); - Assert.True(segment.Length == 2); + Assert.IsTrue(segment.Length == 2); } [TestMethod] @@ -28,7 +28,7 @@ namespace Iot.Device.Multiplexing segment.Write(i, i % 2); } - Assert.True( + Assert.IsTrue( segment[0] == 0 && segment[1] == 1 && segment[2] == 0 && @@ -41,7 +41,7 @@ namespace Iot.Device.Multiplexing VirtualOutputSegment segment = new(8); segment.Write(0b_1001_0110); - Assert.True( + Assert.IsTrue( segment[0] == 0 && segment[1] == 1 && segment[2] == 1 && @@ -63,7 +63,7 @@ namespace Iot.Device.Multiplexing } - Assert.True( + Assert.IsTrue( segment[0] == 0 && segment[1] == 1 && segment[2] == 0 && @@ -87,12 +87,12 @@ namespace Iot.Device.Multiplexing { VirtualOutputSegment segment = new(8); segment.Write(255); - Assert.True(segment[3] == 1); + Assert.IsTrue(segment[3] == 1); segment.TurnOffAll(); for (int i = 0; i < segment.Length; i++) { - Assert.True(segment[i] == 0); + Assert.IsTrue(segment[i] == 0); } } } diff --git a/tests/Iot.Device.Multiplexing.UnitTests/nano.runsettings b/tests/Iot.Device.Multiplexing.UnitTests/nano.runsettings deleted file mode 100644 index fa881e3a2..000000000 --- a/tests/Iot.Device.Multiplexing.UnitTests/nano.runsettings +++ /dev/null @@ -1,14 +0,0 @@ - - - - - 1 - .\TestResults - 120000 - Framework40 - - - None - False - - \ No newline at end of file diff --git a/tests/Iot.Device.Multiplexing.UnitTests/packages.config b/tests/Iot.Device.Multiplexing.UnitTests/packages.config index 5dac66126..20587580e 100644 --- a/tests/Iot.Device.Multiplexing.UnitTests/packages.config +++ b/tests/Iot.Device.Multiplexing.UnitTests/packages.config @@ -1,7 +1,7 @@  - - - - + + + + \ No newline at end of file diff --git a/tests/Iot.Device.Multiplexing.UnitTests/packages.lock.json b/tests/Iot.Device.Multiplexing.UnitTests/packages.lock.json new file mode 100644 index 000000000..aeb3658a1 --- /dev/null +++ b/tests/Iot.Device.Multiplexing.UnitTests/packages.lock.json @@ -0,0 +1,31 @@ +{ + "version": 1, + "dependencies": { + ".NETnanoFramework,Version=v1.0": { + "nanoFramework.CoreLibrary": { + "type": "Direct", + "requested": "[1.12.0, 1.12.0]", + "resolved": "1.12.0", + "contentHash": "qQrFNXmJiStMC4VXk5cVMOJp23/qlT9FW5i9i+igwQVwraQTtvpkam8yK1hj992jqrbjoCIFZP4Hw9E8H0pB7w==" + }, + "nanoFramework.Runtime.Events": { + "type": "Direct", + "requested": "[1.11.1, 1.11.1]", + "resolved": "1.11.1", + "contentHash": "hHRPhNagq1T0oN9QJfPOqreuWUV42DJamT0f7GrPQvrOYcr9ne4YTZq8MIpudvKtSALs50iYqxJ+raOF2CiNsA==" + }, + "nanoFramework.System.Device.Gpio": { + "type": "Direct", + "requested": "[1.1.22, 1.1.22]", + "resolved": "1.1.22", + "contentHash": "yR+uD2YZDLJMP0E0zcQk+kEYM2/Yvs6FR8jYJe9FgaETJeyLdIyRXISmb5BaF4vbkaCC9jt60cpzg1xvmKDwcQ==" + }, + "nanoFramework.TestFramework": { + "type": "Direct", + "requested": "[2.1.53, 2.1.53]", + "resolved": "2.1.53", + "contentHash": "Qr070ITYv5XZ6E54+bDhFEOaCOcrx/oSOUK/uWYnQrCLTH9Tanf/fhEnWOViMk8nOiuXsPtY00Aen+57lrVsFg==" + } + } + } +} \ No newline at end of file diff --git a/tests/System.Device.Model.UnitTests/System.Device.Model.UnitTests.nfproj b/tests/System.Device.Model.UnitTests/System.Device.Model.UnitTests.nfproj index ff769487c..ed93eb1e6 100644 --- a/tests/System.Device.Model.UnitTests/System.Device.Model.UnitTests.nfproj +++ b/tests/System.Device.Model.UnitTests/System.Device.Model.UnitTests.nfproj @@ -21,39 +21,35 @@ true UnitTest v1.0 + true + true - - $(MSBuildProjectDirectory)\nano.runsettings - - - ..\..\src\System.Device.Model\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll - True - True + + ..\..\src\System.Device.Model\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll - - ..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.TestFramework.dll - True - True + + ..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll - - ..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.UnitTestLauncher.exe - True - True + + ..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe - + + + + - + @@ -63,6 +59,6 @@ Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - + \ No newline at end of file diff --git a/tests/System.Device.Model.UnitTests/nano.runsettings b/tests/System.Device.Model.UnitTests/nano.runsettings deleted file mode 100644 index fa881e3a2..000000000 --- a/tests/System.Device.Model.UnitTests/nano.runsettings +++ /dev/null @@ -1,14 +0,0 @@ - - - - - 1 - .\TestResults - 120000 - Framework40 - - - None - False - - \ No newline at end of file diff --git a/tests/System.Device.Model.UnitTests/packages.config b/tests/System.Device.Model.UnitTests/packages.config index d2c81bf89..482523c7a 100644 --- a/tests/System.Device.Model.UnitTests/packages.config +++ b/tests/System.Device.Model.UnitTests/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/tests/System.Device.Model.UnitTests/packages.lock.json b/tests/System.Device.Model.UnitTests/packages.lock.json new file mode 100644 index 000000000..3322b791c --- /dev/null +++ b/tests/System.Device.Model.UnitTests/packages.lock.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "dependencies": { + ".NETnanoFramework,Version=v1.0": { + "nanoFramework.CoreLibrary": { + "type": "Direct", + "requested": "[1.12.0, 1.12.0]", + "resolved": "1.12.0", + "contentHash": "qQrFNXmJiStMC4VXk5cVMOJp23/qlT9FW5i9i+igwQVwraQTtvpkam8yK1hj992jqrbjoCIFZP4Hw9E8H0pB7w==" + }, + "nanoFramework.TestFramework": { + "type": "Direct", + "requested": "[2.1.53, 2.1.53]", + "resolved": "2.1.53", + "contentHash": "Qr070ITYv5XZ6E54+bDhFEOaCOcrx/oSOUK/uWYnQrCLTH9Tanf/fhEnWOViMk8nOiuXsPtY00Aen+57lrVsFg==" + } + } + } +} \ No newline at end of file diff --git a/tests/System.Drawing.Tests/ColorTests.cs b/tests/System.Drawing.Tests/ColorTests.cs index c7852860a..eb41e2903 100644 --- a/tests/System.Drawing.Tests/ColorTests.cs +++ b/tests/System.Drawing.Tests/ColorTests.cs @@ -13,10 +13,10 @@ namespace System.Drawing.Tests Color color = Color.FromArgb(0x12345678); // Assert - Assert.Equal((byte)0x12, color.A, "A should be 0x12"); - Assert.Equal((byte)0x34, color.R, "R should be 0x34"); - Assert.Equal((byte)0x56, color.G, "G should be 0x56"); - Assert.Equal((byte)0x78, color.B, "B should be 0x78"); + Assert.AreEqual((byte)0x12, color.A, "A should be 0x12"); + Assert.AreEqual((byte)0x34, color.R, "R should be 0x34"); + Assert.AreEqual((byte)0x56, color.G, "G should be 0x56"); + Assert.AreEqual((byte)0x78, color.B, "B should be 0x78"); } [TestMethod] @@ -26,10 +26,10 @@ namespace System.Drawing.Tests Color color = Color.FromArgb(0x12, 0x34, 0x56, 0x78); // Assert - Assert.Equal((byte)0x12, color.A, "A should be 0x12"); - Assert.Equal((byte)0x34, color.R, "R should be 0x34"); - Assert.Equal((byte)0x56, color.G, "G should be 0x56"); - Assert.Equal((byte)0x78, color.B, "B should be 0x78"); + Assert.AreEqual((byte)0x12, color.A, "A should be 0x12"); + Assert.AreEqual((byte)0x34, color.R, "R should be 0x34"); + Assert.AreEqual((byte)0x56, color.G, "G should be 0x56"); + Assert.AreEqual((byte)0x78, color.B, "B should be 0x78"); } [TestMethod] @@ -39,10 +39,10 @@ namespace System.Drawing.Tests Color color = Color.FromArgb(0x34, 0x56, 0x78); // Assert - Assert.Equal((byte)0xFF, color.A, "A should be 0xFF"); - Assert.Equal((byte)0x34, color.R, "R should be 0x34"); - Assert.Equal((byte)0x56, color.G, "G should be 0x56"); - Assert.Equal((byte)0x78, color.B, "B should be 0x78"); + Assert.AreEqual((byte)0xFF, color.A, "A should be 0xFF"); + Assert.AreEqual((byte)0x34, color.R, "R should be 0x34"); + Assert.AreEqual((byte)0x56, color.G, "G should be 0x56"); + Assert.AreEqual((byte)0x78, color.B, "B should be 0x78"); } [TestMethod] @@ -52,10 +52,10 @@ namespace System.Drawing.Tests Color color = Color.Red; // Assert - Assert.Equal((byte)0xFF, color.A, "A should be 0xFF"); - Assert.Equal((byte)0xFF, color.R, "R should be 0xFF"); - Assert.Equal((byte)0x00, color.G, "G should be 0x00"); - Assert.Equal((byte)0x00, color.B, "B should be 0x00"); + Assert.AreEqual((byte)0xFF, color.A, "A should be 0xFF"); + Assert.AreEqual((byte)0xFF, color.R, "R should be 0xFF"); + Assert.AreEqual((byte)0x00, color.G, "G should be 0x00"); + Assert.AreEqual((byte)0x00, color.B, "B should be 0x00"); } // @@ -65,34 +65,34 @@ namespace System.Drawing.Tests { //TODO: Rewrite to [DataTestMethod] [DataRow('1',1)] when become supported var result1 = Color.ParseHexChar('1'); - Assert.Equal(result1, 1); + Assert.AreEqual(result1, 1); var result9 = Color.ParseHexChar('9'); - Assert.Equal(result9, 9); + Assert.AreEqual(result9, 9); var resulta = Color.ParseHexChar('a'); - Assert.Equal(resulta, 10); + Assert.AreEqual(resulta, 10); var resultb = Color.ParseHexChar('b'); - Assert.Equal(resultb, 11); + Assert.AreEqual(resultb, 11); var resultc = Color.ParseHexChar('c'); - Assert.Equal(resultc, 12); + Assert.AreEqual(resultc, 12); var resultf = Color.ParseHexChar('f'); - Assert.Equal(resultf, 15); + Assert.AreEqual(resultf, 15); var resultA = Color.ParseHexChar('A'); - Assert.Equal(resultA, 10); + Assert.AreEqual(resultA, 10); var resultD = Color.ParseHexChar('D'); - Assert.Equal(resultD, 13); + Assert.AreEqual(resultD, 13); var resultE = Color.ParseHexChar('E'); - Assert.Equal(resultE, 14); + Assert.AreEqual(resultE, 14); var resultF = Color.ParseHexChar('F'); - Assert.Equal(resultF, 15); + Assert.AreEqual(resultF, 15); } [TestMethod] public void ParseHexChar_Exceptions_Test() { - Assert.Throws(typeof(FormatException), () => Color.ParseHexChar('x')); - Assert.Throws(typeof(FormatException), () => Color.ParseHexChar(Char.MinValue)); - Assert.Throws(typeof(FormatException), () => Color.ParseHexChar(Char.MaxValue)); + Assert.ThrowsException(typeof(FormatException), () => Color.ParseHexChar('x')); + Assert.ThrowsException(typeof(FormatException), () => Color.ParseHexChar(Char.MinValue)); + Assert.ThrowsException(typeof(FormatException), () => Color.ParseHexChar(Char.MaxValue)); } [TestMethod] @@ -100,15 +100,15 @@ namespace System.Drawing.Tests { //TODO: Rewrite to [DataTestMethod] [DataRow("#FFFF0000",Color.Red)] when become supported var red = Color.ParseHex("#FFFF0000"); - Assert.True(red == Color.Red, "not Red"); + Assert.IsTrue(red == Color.Red, "not Red"); var green = Color.ParseHex("#FF008000"); - Assert.True(green == Color.Green, "not Green"); + Assert.IsTrue(green == Color.Green, "not Green"); var blue = Color.ParseHex("#FF0000FF"); - Assert.True(blue == Color.Blue, "not Blue"); + Assert.IsTrue(blue == Color.Blue, "not Blue"); var black = Color.ParseHex("#FF000000"); - Assert.True(black == Color.Black, "not Black"); + Assert.IsTrue(black == Color.Black, "not Black"); var white = Color.ParseHex("#FFFFFFFF"); - Assert.True(white == Color.White, "not White"); + Assert.IsTrue(white == Color.White, "not White"); } [TestMethod] @@ -116,15 +116,15 @@ namespace System.Drawing.Tests { //TODO: Rewrite to [DataTestMethod] [DataRow("#FF0000",Color.Red)] when become supported var red = Color.ParseHex("#FF0000"); - Assert.True(red == Color.Red, "not Red"); + Assert.IsTrue(red == Color.Red, "not Red"); var green = Color.ParseHex("#008000"); - Assert.True(green == Color.Green, "not Green"); + Assert.IsTrue(green == Color.Green, "not Green"); var blue = Color.ParseHex("#0000FF"); - Assert.True(blue == Color.Blue, "not Blue"); + Assert.IsTrue(blue == Color.Blue, "not Blue"); var black = Color.ParseHex("#000000"); - Assert.True(black == Color.Black, "not Black"); + Assert.IsTrue(black == Color.Black, "not Black"); var white = Color.ParseHex("#FFFFFF"); - Assert.True(white == Color.White, "not White"); + Assert.IsTrue(white == Color.White, "not White"); } [TestMethod] @@ -132,15 +132,15 @@ namespace System.Drawing.Tests { //TODO: Rewrite to [DataTestMethod] [DataRow("#FF00",Color.Red)] when become supported var red = Color.ParseHex("#FF00"); - Assert.True(red == Color.Red, "not Red"); + Assert.IsTrue(red == Color.Red, "not Red"); var green = Color.ParseHex("#F0F0"); - Assert.True(green == Color.Lime, "not Lime"); + Assert.IsTrue(green == Color.Lime, "not Lime"); var blue = Color.ParseHex("#F00F"); - Assert.True(blue == Color.Blue, "not Blue"); + Assert.IsTrue(blue == Color.Blue, "not Blue"); var black = Color.ParseHex("#F000"); - Assert.True(black == Color.Black, "not Black"); + Assert.IsTrue(black == Color.Black, "not Black"); var white = Color.ParseHex("#FFFF"); - Assert.True(white == Color.White, "not White"); + Assert.IsTrue(white == Color.White, "not White"); } [TestMethod] @@ -148,28 +148,28 @@ namespace System.Drawing.Tests { //TODO: Rewrite to [DataTestMethod] [DataRow("#F00",Color.Red)] when become supported var red = Color.ParseHex("#F00"); - Assert.True(red == Color.Red, "not Red."); + Assert.IsTrue(red == Color.Red, "not Red."); var green = Color.ParseHex("#0F0"); - Assert.True(green == Color.Lime, "not Lime."); + Assert.IsTrue(green == Color.Lime, "not Lime."); var blue = Color.ParseHex("#00F"); - Assert.True(blue == Color.Blue, "not Blue."); + Assert.IsTrue(blue == Color.Blue, "not Blue."); var black = Color.ParseHex("#000"); - Assert.True(black == Color.Black, "not Black."); + Assert.IsTrue(black == Color.Black, "not Black."); var white = Color.ParseHex("#FFF"); - Assert.True(white == Color.White, "not White."); + Assert.IsTrue(white == Color.White, "not White."); } [TestMethod] public void ParseHexColor_Exceptions_Test() { - Assert.Throws(typeof(FormatException), () => Color.ParseHex("#RRGGBB")); // ilegal characters - Assert.Throws(typeof(ArgumentException), () => Color.ParseHex("112233")); // leading # missing - Assert.Throws(typeof(ArgumentException), () => Color.ParseHex("#")); // too short - Assert.Throws(typeof(ArgumentException), () => Color.ParseHex("#1"));// too short - Assert.Throws(typeof(ArgumentException), () => Color.ParseHex("#12"));// too short - Assert.Throws(typeof(ArgumentException), () => Color.ParseHex("#12345"));// length of 6 not match - Assert.Throws(typeof(ArgumentException), () => Color.ParseHex("#1234567"));// length of 8 not match - Assert.Throws(typeof(ArgumentException), () => Color.ParseHex("#1234567890")); // too long + Assert.ThrowsException(typeof(FormatException), () => Color.ParseHex("#RRGGBB")); // ilegal characters + Assert.ThrowsException(typeof(ArgumentException), () => Color.ParseHex("112233")); // leading # missing + Assert.ThrowsException(typeof(ArgumentException), () => Color.ParseHex("#")); // too short + Assert.ThrowsException(typeof(ArgumentException), () => Color.ParseHex("#1"));// too short + Assert.ThrowsException(typeof(ArgumentException), () => Color.ParseHex("#12"));// too short + Assert.ThrowsException(typeof(ArgumentException), () => Color.ParseHex("#12345"));// length of 6 not match + Assert.ThrowsException(typeof(ArgumentException), () => Color.ParseHex("#1234567"));// length of 8 not match + Assert.ThrowsException(typeof(ArgumentException), () => Color.ParseHex("#1234567890")); // too long } } } \ No newline at end of file diff --git a/tests/System.Drawing.Tests/System.Drawing.Tests.nfproj b/tests/System.Drawing.Tests/System.Drawing.Tests.nfproj index 1427d09cb..0257ca291 100644 --- a/tests/System.Drawing.Tests/System.Drawing.Tests.nfproj +++ b/tests/System.Drawing.Tests/System.Drawing.Tests.nfproj @@ -21,42 +21,37 @@ true UnitTest v1.0 + true + true - - $(MSBuildProjectDirectory)\nano.runsettings - - - ..\..\devices\System.Drawing\packages\nanoFramework.CoreLibrary.1.12.0-preview.5\lib\mscorlib.dll - True - True + + + + + ..\..\devices\System.Drawing\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll - - ..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.1.0.173\lib\nanoFramework.TestFramework.dll - True - True + + ..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll - - ..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.1.0.173\lib\nanoFramework.UnitTestLauncher.exe - True - True + + ..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe - - + - + @@ -66,6 +61,6 @@ Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - + \ No newline at end of file diff --git a/tests/System.Drawing.Tests/nano.runsettings b/tests/System.Drawing.Tests/nano.runsettings deleted file mode 100644 index fa881e3a2..000000000 --- a/tests/System.Drawing.Tests/nano.runsettings +++ /dev/null @@ -1,14 +0,0 @@ - - - - - 1 - .\TestResults - 120000 - Framework40 - - - None - False - - \ No newline at end of file diff --git a/tests/System.Drawing.Tests/packages.config b/tests/System.Drawing.Tests/packages.config index 9ff30d0a2..482523c7a 100644 --- a/tests/System.Drawing.Tests/packages.config +++ b/tests/System.Drawing.Tests/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/tests/System.Drawing.Tests/packages.lock.json b/tests/System.Drawing.Tests/packages.lock.json index bac6a6504..3322b791c 100644 --- a/tests/System.Drawing.Tests/packages.lock.json +++ b/tests/System.Drawing.Tests/packages.lock.json @@ -4,15 +4,15 @@ ".NETnanoFramework,Version=v1.0": { "nanoFramework.CoreLibrary": { "type": "Direct", - "requested": "[1.12.0-preview.5, 1.12.0-preview.5]", - "resolved": "1.12.0-preview.5", - "contentHash": "OVqAeEJqUPogVY0q7YMgMbwgcCiVVwVIu5XG6CBxkcs/B+RY30xYLSB4Gd61sxPq8ymXDAW76dOkWi1N2JL9Cw==" + "requested": "[1.12.0, 1.12.0]", + "resolved": "1.12.0", + "contentHash": "qQrFNXmJiStMC4VXk5cVMOJp23/qlT9FW5i9i+igwQVwraQTtvpkam8yK1hj992jqrbjoCIFZP4Hw9E8H0pB7w==" }, "nanoFramework.TestFramework": { "type": "Direct", - "requested": "[1.0.173, 1.0.173]", - "resolved": "1.0.173", - "contentHash": "sDuRN31etkR4Dlqp6Q27XKmZlYS3OmKMXMw+qSF8Lfy3QHYtc5l9L5mks6zvOUaBF+6DwBsBRDqQ7cmEahjjaw==" + "requested": "[2.1.53, 2.1.53]", + "resolved": "2.1.53", + "contentHash": "Qr070ITYv5XZ6E54+bDhFEOaCOcrx/oSOUK/uWYnQrCLTH9Tanf/fhEnWOViMk8nOiuXsPtY00Aen+57lrVsFg==" } } } diff --git a/tests/System.Numerics.UnitTests/System.Numerics.UnitTests.nfproj b/tests/System.Numerics.UnitTests/System.Numerics.UnitTests.nfproj index 9769e07c6..006643b16 100644 --- a/tests/System.Numerics.UnitTests/System.Numerics.UnitTests.nfproj +++ b/tests/System.Numerics.UnitTests/System.Numerics.UnitTests.nfproj @@ -22,46 +22,40 @@ UnitTest v1.0 true + true + true - - $(MSBuildProjectDirectory)\nano.runsettings - - - ..\..\src\System.Numerics\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll - True - True + + ..\..\devices\System.Numerics\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll - - ..\..\src\System.Numerics\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.TestFramework.dll - True - True + + ..\..\devices\System.Numerics\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll - - ..\..\src\System.Numerics\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.UnitTestLauncher.exe - True - True + + ..\..\devices\System.Numerics\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe - - ..\..\src\System.Numerics\packages\nanoFramework.System.Math.1.4.1.3\lib\System.Math.dll - True - True + + ..\..\devices\System.Numerics\packages\nanoFramework.System.Math.1.5.18\lib\System.Math.dll - - - + + + + + + - + @@ -71,6 +65,6 @@ Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder. - + \ No newline at end of file diff --git a/tests/System.Numerics.UnitTests/app.config b/tests/System.Numerics.UnitTests/app.config deleted file mode 100644 index fc68357f7..000000000 --- a/tests/System.Numerics.UnitTests/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/tests/System.Numerics.UnitTests/nano.runsettings b/tests/System.Numerics.UnitTests/nano.runsettings deleted file mode 100644 index fa881e3a2..000000000 --- a/tests/System.Numerics.UnitTests/nano.runsettings +++ /dev/null @@ -1,14 +0,0 @@ - - - - - 1 - .\TestResults - 120000 - Framework40 - - - None - False - - \ No newline at end of file diff --git a/tests/System.Numerics.UnitTests/packages.config b/tests/System.Numerics.UnitTests/packages.config index 71b896e58..d46e1812f 100644 --- a/tests/System.Numerics.UnitTests/packages.config +++ b/tests/System.Numerics.UnitTests/packages.config @@ -1,6 +1,6 @@  - - - + + + \ No newline at end of file diff --git a/tests/System.Numerics.UnitTests/packages.lock.json b/tests/System.Numerics.UnitTests/packages.lock.json new file mode 100644 index 000000000..cd5595efc --- /dev/null +++ b/tests/System.Numerics.UnitTests/packages.lock.json @@ -0,0 +1,25 @@ +{ + "version": 1, + "dependencies": { + ".NETnanoFramework,Version=v1.0": { + "nanoFramework.CoreLibrary": { + "type": "Direct", + "requested": "[1.12.0, 1.12.0]", + "resolved": "1.12.0", + "contentHash": "qQrFNXmJiStMC4VXk5cVMOJp23/qlT9FW5i9i+igwQVwraQTtvpkam8yK1hj992jqrbjoCIFZP4Hw9E8H0pB7w==" + }, + "nanoFramework.System.Math": { + "type": "Direct", + "requested": "[1.5.18, 1.5.18]", + "resolved": "1.5.18", + "contentHash": "xsqy3+1gblbeItzVuwDeJlFezy5N8V7CHPATsW1941kZiCNqv0cgcjmurFHSvjkQ3JZUPj5y7dLdcWtusds18Q==" + }, + "nanoFramework.TestFramework": { + "type": "Direct", + "requested": "[2.1.53, 2.1.53]", + "resolved": "2.1.53", + "contentHash": "Qr070ITYv5XZ6E54+bDhFEOaCOcrx/oSOUK/uWYnQrCLTH9Tanf/fhEnWOViMk8nOiuXsPtY00Aen+57lrVsFg==" + } + } + } +} \ No newline at end of file