***NO_CI***
This commit is contained in:
José Simões 2022-12-22 12:08:41 +00:00 коммит произвёл GitHub
Родитель f6e6dd0f98
Коммит a689eaf6f4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
29 изменённых файлов: 434 добавлений и 383 удалений

Просмотреть файл

@ -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");
//}
}
}

Просмотреть файл

@ -21,6 +21,8 @@
<IsTestProject>true</IsTestProject>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' or '$(ContinuousIntegrationBuild)' == 'True'">true</RestoreLockedMode>
</PropertyGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
<PropertyGroup>
@ -31,20 +33,14 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib, Version=1.10.5.4, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.CoreLibrary.1.10.5\lib\mscorlib.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="mscorlib">
<HintPath>..\..\src\BinaryPrimitives\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.TestFramework, Version=1.0.154.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.1.0.154\lib\nanoFramework.TestFramework.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.TestFramework">
<HintPath>..\..\src\BinaryPrimitives\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.UnitTestLauncher, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.1.0.154\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.UnitTestLauncher">
<HintPath>..\..\src\BinaryPrimitives\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -52,12 +48,12 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DummyBinaryPrimitivesProject\DummyBinaryPrimitivesProject.nfproj" />
<Content Include="packages.lock.json" />
</ItemGroup>
<Import Project="..\..\src\BinaryPrimitives\BinaryPrimitives.projitems" Label="Shared" />
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<!-- MANUAL UPDATE HERE -->
<Import Project="..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.1.0.154\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.1.0.154\build\nanoFramework.TestFramework.targets')" />
<Import Project="..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" />
<ProjectExtensions>
<ProjectCapabilities>
<ProjectConfigurationsDeclaredAsItems />
@ -67,6 +63,6 @@
<PropertyGroup>
<WarningText>Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder.</WarningText>
</PropertyGroup>
<Warning Condition="!Exists('..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.1.0.154\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
<Warning Condition="!Exists('..\..\devices\System.Buffers.Binary.BinaryPrimitives\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
</Target>
</Project>

Просмотреть файл

@ -5,7 +5,8 @@
<MaxCpuCount>1</MaxCpuCount>
<ResultsDirectory>.\TestResults</ResultsDirectory><!-- Path relative to solution directory -->
<TestSessionTimeout>120000</TestSessionTimeout><!-- Milliseconds -->
<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>
<TargetFrameworkVersion>net48</TargetFrameworkVersion>
<TargetPlatform>x64</TargetPlatform>
</RunConfiguration>
<nanoFrameworkAdapter>
<Logging>None</Logging>

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.10.5" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="1.0.154" targetFramework="netnano1.0" developmentDependency="true" />
<package id="nanoFramework.CoreLibrary" version="1.12.0" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="2.1.53" targetFramework="netnano1.0" developmentDependency="true" />
</packages>

Просмотреть файл

@ -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=="
}
}
}

Просмотреть файл

@ -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<EFBFBD>, 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));
//}
}
}

Просмотреть файл

@ -21,6 +21,8 @@
<IsTestProject>true</IsTestProject>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' or '$(ContinuousIntegrationBuild)' == 'True'">true</RestoreLockedMode>
</PropertyGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
<PropertyGroup>
@ -31,41 +33,55 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib">
<HintPath>..\..\src\Iot.Device.Common\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll</HintPath>
</Reference>
<Reference Include="mscorlib, Version=1.10.4.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Common\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="nanoFramework.TestFramework, Version=1.0.121.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.1.0.121\lib\nanoFramework.TestFramework.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.TestFramework">
<HintPath>..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.UnitTestLauncher, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.1.0.121\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.UnitTestLauncher">
<HintPath>..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
</Reference>
<Reference Include="System.Math">
<HintPath>..\..\src\Iot.Device.Common\packages\nanoFramework.System.Math.1.5.18\lib\System.Math.dll</HintPath>
</Reference>
<Reference Include="System.Math, Version=1.4.1.3, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Common\packages\nanoFramework.System.Math.1.4.1\lib\System.Math.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="UnitsNet.Length">
<HintPath>..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Length.4.148.0\lib\UnitsNet.Length.dll</HintPath>
</Reference>
<Reference Include="UnitsNet.Length, Version=4.101.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Length.4.101.0\lib\UnitsNet.Length.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="UnitsNet.Pressure">
<HintPath>..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Pressure.4.148.0\lib\UnitsNet.Pressure.dll</HintPath>
</Reference>
<Reference Include="UnitsNet.Pressure, Version=4.101.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Pressure.4.101.0\lib\UnitsNet.Pressure.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="UnitsNet.RelativeHumidity">
<HintPath>..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.RelativeHumidity.4.148.0\lib\UnitsNet.RelativeHumidity.dll</HintPath>
</Reference>
<Reference Include="UnitsNet.RelativeHumidity, Version=4.101.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.RelativeHumidity.4.101.0\lib\UnitsNet.RelativeHumidity.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="UnitsNet.Temperature">
<HintPath>..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Temperature.4.148.0\lib\UnitsNet.Temperature.dll</HintPath>
</Reference>
<Reference Include="UnitsNet.Temperature, Version=4.101.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\src\Iot.Device.Common\packages\UnitsNet.nanoFramework.Temperature.4.101.0\lib\UnitsNet.Temperature.dll</HintPath>
<Private>True</Private>
@ -76,10 +92,13 @@
<None Include="nano.runsettings" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.lock.json" />
</ItemGroup>
<Import Project="..\..\src\Iot.Device.Common\Iot.Device.Common.projitems" Label="Shared" />
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<!-- MANUAL UPDATE HERE -->
<Import Project="..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.1.0.121\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.1.0.121\build\nanoFramework.TestFramework.targets')" />
<Import Project="..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" />
<ProjectExtensions>
<ProjectCapabilities>
<ProjectConfigurationsDeclaredAsItems />
@ -89,6 +108,6 @@
<PropertyGroup>
<WarningText>Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder.</WarningText>
</PropertyGroup>
<Warning Condition="!Exists('..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.1.0.121\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
<Warning Condition="!Exists('..\..\src\Iot.Device.Common\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
</Target>
</Project>

Просмотреть файл

@ -5,7 +5,8 @@
<MaxCpuCount>1</MaxCpuCount>
<ResultsDirectory>.\TestResults</ResultsDirectory><!-- Path relative to solution directory -->
<TestSessionTimeout>120000</TestSessionTimeout><!-- Milliseconds -->
<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>
<TargetFrameworkVersion>net48</TargetFrameworkVersion>
<TargetPlatform>x64</TargetPlatform>
</RunConfiguration>
<nanoFrameworkAdapter>
<Logging>None</Logging>

Просмотреть файл

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.10.4-preview.11" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Math" version="1.4.0-preview.9" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="1.0.121" targetFramework="netnano1.0" developmentDependency="true" />
<package id="UnitsNet.nanoFramework.Length" version="4.92.1" targetFramework="netnano1.0" />
<package id="UnitsNet.nanoFramework.Pressure" version="4.92.1" targetFramework="netnano1.0" />
<package id="UnitsNet.nanoFramework.RelativeHumidity" version="4.92.1" targetFramework="netnano1.0" />
<package id="UnitsNet.nanoFramework.Temperature" version="4.92.1" targetFramework="netnano1.0" />
<package id="nanoFramework.CoreLibrary" version="1.12.0" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Math" version="1.5.18" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="2.1.53" targetFramework="netnano1.0" developmentDependency="true" />
<package id="UnitsNet.nanoFramework.Length" version="4.148.0" targetFramework="netnano1.0" />
<package id="UnitsNet.nanoFramework.Pressure" version="4.148.0" targetFramework="netnano1.0" />
<package id="UnitsNet.nanoFramework.RelativeHumidity" version="4.148.0" targetFramework="netnano1.0" />
<package id="UnitsNet.nanoFramework.Temperature" version="4.148.0" targetFramework="netnano1.0" />
</packages>

Просмотреть файл

@ -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=="
}
}
}
}

Просмотреть файл

@ -21,51 +21,43 @@
<IsTestProject>true</IsTestProject>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' or '$(ContinuousIntegrationBuild)' == 'True'">true</RestoreLockedMode>
</PropertyGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
<PropertyGroup>
<RunSettingsFilePath>$(MSBuildProjectDirectory)\nano.runsettings</RunSettingsFilePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="OutputSegmentTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="nano.runsettings" />
<Reference Include="mscorlib">
<HintPath>..\..\devices\Multiplexing\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.Runtime.Events">
<HintPath>..\..\devices\Multiplexing\packages\nanoFramework.Runtime.Events.1.11.1\lib\nanoFramework.Runtime.Events.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.TestFramework">
<HintPath>..\..\devices\Multiplexing\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.UnitTestLauncher">
<HintPath>..\..\devices\Multiplexing\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
</Reference>
<Reference Include="System.Device.Gpio">
<HintPath>..\..\devices\Multiplexing\packages\nanoFramework.System.Device.Gpio.1.1.22\lib\System.Device.Gpio.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib, Version=1.10.4.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="nanoFramework.Runtime.Events, Version=1.9.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.Runtime.Events.1.9.0-preview.26\lib\nanoFramework.Runtime.Events.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="nanoFramework.TestFramework, Version=1.0.117.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.TestFramework.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="nanoFramework.UnitTestLauncher, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="System.Device.Gpio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\Iot.Device.Multiplexing\packages\nanoFramework.System.Device.Gpio.1.0.0-preview.40\lib\System.Device.Gpio.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Content Include="packages.lock.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\devices\Multiplexing\Multiplexing.nfproj" />
</ItemGroup>
<Import Project="..\..\src\Iot.Device.Multiplexing\Iot.Device.Multiplexing.projitems" Label="Shared" />
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<!-- MANUAL UPDATE HERE -->
<Import Project="..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets" Condition="Exists('..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets')" />
<Import Project="..\..\devices\Multiplexing\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\devices\Multiplexing\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" />
<ProjectExtensions>
<ProjectCapabilities>
<ProjectConfigurationsDeclaredAsItems />
@ -75,6 +67,6 @@
<PropertyGroup>
<WarningText>Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder.</WarningText>
</PropertyGroup>
<Warning Condition="!Exists('..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
<Warning Condition="!Exists('..\..\devices\Multiplexing\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
</Target>
</Project>

Просмотреть файл

@ -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);
}
}
}

Просмотреть файл

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<MaxCpuCount>1</MaxCpuCount>
<ResultsDirectory>.\TestResults</ResultsDirectory><!-- Path relative to solution directory -->
<TestSessionTimeout>120000</TestSessionTimeout><!-- Milliseconds -->
<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>
</RunConfiguration>
<nanoFrameworkAdapter>
<Logging>None</Logging>
<IsRealHardware>False</IsRealHardware>
</nanoFrameworkAdapter>
</RunSettings>

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.10.4-preview.11" targetFramework="netnano1.0" />
<package id="nanoFramework.Runtime.Events" version="1.9.0-preview.26" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Device.Gpio" version="1.0.0-preview.40" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="1.0.117" targetFramework="netnano1.0" developmentDependency="true" />
<package id="nanoFramework.CoreLibrary" version="1.12.0" targetFramework="netnano1.0" />
<package id="nanoFramework.Runtime.Events" version="1.11.1" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Device.Gpio" version="1.1.22" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="2.1.53" targetFramework="netnano1.0" developmentDependency="true" />
</packages>

Просмотреть файл

@ -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=="
}
}
}
}

Просмотреть файл

@ -21,39 +21,35 @@
<IsTestProject>true</IsTestProject>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' or '$(ContinuousIntegrationBuild)' == 'True'">true</RestoreLockedMode>
</PropertyGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
<PropertyGroup>
<RunSettingsFilePath>$(MSBuildProjectDirectory)\nano.runsettings</RunSettingsFilePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Device.Model.UnitTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib, Version=1.10.4.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\System.Device.Model\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="mscorlib">
<HintPath>..\..\src\System.Device.Model\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.TestFramework, Version=1.0.117.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.TestFramework.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.TestFramework">
<HintPath>..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.UnitTestLauncher, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.UnitTestLauncher">
<HintPath>..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="nano.runsettings" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.lock.json" />
</ItemGroup>
<Import Project="..\..\src\System.Device.Model\System.Device.Model.projitems" Label="Shared" />
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<!-- MANUAL UPDATE HERE -->
<Import Project="..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets" Condition="Exists('..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets')" />
<Import Project="..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" />
<ProjectExtensions>
<ProjectCapabilities>
<ProjectConfigurationsDeclaredAsItems />
@ -63,6 +59,6 @@
<PropertyGroup>
<WarningText>Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder.</WarningText>
</PropertyGroup>
<Warning Condition="!Exists('..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
<Warning Condition="!Exists('..\..\src\System.Device.Model\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
</Target>
</Project>

Просмотреть файл

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<MaxCpuCount>1</MaxCpuCount>
<ResultsDirectory>.\TestResults</ResultsDirectory><!-- Path relative to solution directory -->
<TestSessionTimeout>120000</TestSessionTimeout><!-- Milliseconds -->
<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>
</RunConfiguration>
<nanoFrameworkAdapter>
<Logging>None</Logging>
<IsRealHardware>False</IsRealHardware>
</nanoFrameworkAdapter>
</RunSettings>

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.10.4-preview.11" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="1.0.117" targetFramework="netnano1.0" developmentDependency="true" />
<package id="nanoFramework.CoreLibrary" version="1.12.0" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="2.1.53" targetFramework="netnano1.0" developmentDependency="true" />
</packages>

Просмотреть файл

@ -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=="
}
}
}
}

Просмотреть файл

@ -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
}
}
}

Просмотреть файл

@ -21,42 +21,37 @@
<IsTestProject>true</IsTestProject>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' or '$(ContinuousIntegrationBuild)' == 'True'">true</RestoreLockedMode>
</PropertyGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
<PropertyGroup>
<RunSettingsFilePath>$(MSBuildProjectDirectory)\nano.runsettings</RunSettingsFilePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="ColorTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib, Version=1.12.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\devices\System.Drawing\packages\nanoFramework.CoreLibrary.1.12.0-preview.5\lib\mscorlib.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<ProjectReference Include="..\..\devices\System.Drawing\System.Drawing.nfproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib">
<HintPath>..\..\devices\System.Drawing\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.TestFramework, Version=1.0.173.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.1.0.173\lib\nanoFramework.TestFramework.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.TestFramework">
<HintPath>..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.UnitTestLauncher, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.1.0.173\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.UnitTestLauncher">
<HintPath>..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="nano.runsettings" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\devices\System.Drawing\System.Drawing.nfproj" />
<Content Include="packages.lock.json" />
</ItemGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<!-- MANUAL UPDATE HERE -->
<Import Project="..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.1.0.172\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.1.0.172\build\nanoFramework.TestFramework.targets')" />
<Import Project="..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" />
<ProjectExtensions>
<ProjectCapabilities>
<ProjectConfigurationsDeclaredAsItems />
@ -66,6 +61,6 @@
<PropertyGroup>
<WarningText>Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder.</WarningText>
</PropertyGroup>
<Warning Condition="!Exists('..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.1.0.172\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
<Warning Condition="!Exists('..\..\devices\System.Drawing\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
</Target>
</Project>

Просмотреть файл

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<MaxCpuCount>1</MaxCpuCount>
<ResultsDirectory>.\TestResults</ResultsDirectory><!-- Path relative to solution directory -->
<TestSessionTimeout>120000</TestSessionTimeout><!-- Milliseconds -->
<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>
</RunConfiguration>
<nanoFrameworkAdapter>
<Logging>None</Logging>
<IsRealHardware>False</IsRealHardware>
</nanoFrameworkAdapter>
</RunSettings>

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.12.0-preview.5" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="1.0.173" targetFramework="netnano1.0" developmentDependency="true" />
<package id="nanoFramework.CoreLibrary" version="1.12.0" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="2.1.53" targetFramework="netnano1.0" developmentDependency="true" />
</packages>

Просмотреть файл

@ -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=="
}
}
}

Просмотреть файл

@ -22,46 +22,40 @@
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RestoreLockedMode Condition="'$(TF_BUILD)' == 'True' or '$(ContinuousIntegrationBuild)' == 'True'">true</RestoreLockedMode>
</PropertyGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.props" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.props')" />
<PropertyGroup>
<RunSettingsFilePath>$(MSBuildProjectDirectory)\nano.runsettings</RunSettingsFilePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Numerics.UnitTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib, Version=1.10.4.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\System.Numerics\packages\nanoFramework.CoreLibrary.1.10.4-preview.11\lib\mscorlib.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="mscorlib">
<HintPath>..\..\devices\System.Numerics\packages\nanoFramework.CoreLibrary.1.12.0\lib\mscorlib.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.TestFramework, Version=1.0.117.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\System.Numerics\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.TestFramework.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.TestFramework">
<HintPath>..\..\devices\System.Numerics\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.TestFramework.dll</HintPath>
</Reference>
<Reference Include="nanoFramework.UnitTestLauncher, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\System.Numerics\packages\nanoFramework.TestFramework.1.0.117\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="nanoFramework.UnitTestLauncher">
<HintPath>..\..\devices\System.Numerics\packages\nanoFramework.TestFramework.2.1.53\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
</Reference>
<Reference Include="System.Math, Version=1.4.1.3, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\src\System.Numerics\packages\nanoFramework.System.Math.1.4.1.3\lib\System.Math.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
<Reference Include="System.Math">
<HintPath>..\..\devices\System.Numerics\packages\nanoFramework.System.Math.1.5.18\lib\System.Math.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="nano.runsettings" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\..\src\System.Numerics\System.Numerics.projitems" Label="Shared" />
<ItemGroup>
<Content Include="packages.lock.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\devices\System.Numerics\System.Numerics.nfproj" />
</ItemGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<!-- MANUAL UPDATE HERE -->
<Import Project="..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets" Condition="Exists('..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets')" />
<Import Project="..\..\devices\System.Numerics\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets" Condition="Exists('..\..\devices\System.Numerics\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" />
<ProjectExtensions>
<ProjectCapabilities>
<ProjectConfigurationsDeclaredAsItems />
@ -71,6 +65,6 @@
<PropertyGroup>
<WarningText>Update the Import path in nfproj to the correct nanoFramework.TestFramework NuGet package folder.</WarningText>
</PropertyGroup>
<Warning Condition="!Exists('..\packages\nanoFramework.TestFramework.1.0.110\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
<Warning Condition="!Exists('..\..\devices\System.Numerics\packages\nanoFramework.TestFramework.2.1.53\build\nanoFramework.TestFramework.targets')" Text="'$(WarningText)'" />
</Target>
</Project>

Просмотреть файл

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="mscorlib" publicKeyToken="c07d481e9758c731" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.10.4.0" newVersion="1.10.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Просмотреть файл

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<MaxCpuCount>1</MaxCpuCount>
<ResultsDirectory>.\TestResults</ResultsDirectory><!-- Path relative to solution directory -->
<TestSessionTimeout>120000</TestSessionTimeout><!-- Milliseconds -->
<TargetFrameworkVersion>Framework40</TargetFrameworkVersion>
</RunConfiguration>
<nanoFrameworkAdapter>
<Logging>None</Logging>
<IsRealHardware>False</IsRealHardware>
</nanoFrameworkAdapter>
</RunSettings>

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.10.4-preview.11" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Math" version="1.4.0-preview.7" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="1.0.117" targetFramework="netnano1.0" developmentDependency="true" />
<package id="nanoFramework.CoreLibrary" version="1.12.0" targetFramework="netnano1.0" />
<package id="nanoFramework.System.Math" version="1.5.18" targetFramework="netnano1.0" />
<package id="nanoFramework.TestFramework" version="2.1.53" targetFramework="netnano1.0" developmentDependency="true" />
</packages>

Просмотреть файл

@ -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=="
}
}
}
}