Skip to content

Commit

Permalink
Fixing more unit tests (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
edleno2 authored May 31, 2021
1 parent da9c46e commit 58b00dc
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 63 deletions.
134 changes: 77 additions & 57 deletions Tests/NFUnitTestSystemLib/UnitTestParseTests.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Tests/NFUnitTestSystemLib/UnitTestTypeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ public void Number_ToString_Test()

Assert.Equal("NaN", ((float)0f / 0f).ToString());
Assert.Equal("Infinity", ((float)1f / 0f).ToString());
Assert.Equal("-Infinity", ((float)-1f / 0f).ToString());
Assert.Equal("-Infinity", ((float)(-1f / 0f)).ToString(),"float negative infinity test");

Assert.Equal("NaN", ((double)0f / 0f).ToString());
Assert.Equal("Infinity", ((double)1f / 0f).ToString());
Assert.Equal("-Infinity", ((double)-1f / 0f).ToString());
Assert.Equal("-Infinity", double.NegativeInfinity.ToString(), "double negative infinity"); // ((double)1f / -0f).ToString());


Assert.Equal("Da1x", (1).ToString("Da1x"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
<Compile Include="..\nanoFramework.CoreLibrary\System\Void.cs" Link="System\Void.cs" />
<Compile Include="..\nanoFramework.CoreLibrary\System\WeakReference.cs" Link="System\WeakReference.cs" />
<Compile Include="..\nanoFramework.CoreLibrary\System\SpanByte.cs" Link="System\SpanByte.cs" />
<Compile Include="..\nanoFramework.CoreLibrary\System\FormatException.cs" Link="System\FormatException.cs" />
</ItemGroup>
<ItemGroup>
<NFMDP_PE_ExcludeClassByName Include="System.AttributeTargets">
Expand Down Expand Up @@ -396,7 +397,7 @@
<None Include="..\nanoFramework.CoreLibrary\key.snk" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Folder Include="System\" />
</ItemGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
Expand All @@ -412,4 +413,4 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\Nerdbank.GitVersioning.3.4.194\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Nerdbank.GitVersioning.3.4.194\build\Nerdbank.GitVersioning.targets'))" />
</Target>
</Project>
</Project>
1 change: 1 addition & 0 deletions nanoFramework.CoreLibrary/CoreLibrary.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<Compile Include="System\EventHandler.cs" />
<Compile Include="System\Exception.cs" />
<Compile Include="System\FlagsAttribute.cs" />
<Compile Include="System\FormatException.cs" />
<Compile Include="System\GC.cs" />
<Compile Include="System\Globalization\CultureInfo.cs" />
<Compile Include="System\Globalization\DateTimeFormat.cs" />
Expand Down
2 changes: 1 addition & 1 deletion nanoFramework.CoreLibrary/System/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
[assembly: AssemblyProduct(".NET nanoFramework mscorlib")]
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]

[assembly: AssemblyNativeVersion("100.5.0.9")]
[assembly: AssemblyNativeVersion("100.5.0.10")]
40 changes: 40 additions & 0 deletions nanoFramework.CoreLibrary/System/FormatException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// Copyright (c) .NET Foundation and Contributors
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
// See LICENSE file in the project root for full license information.
//
namespace System
{
/// <summary>
/// The exception that is thrown for invalid casting or explicit conversion.
/// </summary>
[Serializable]
public class FormatException : SystemException
{
/// <summary>
/// Initializes a new instance of the FormatException class.
/// </summary>
public FormatException()
{
}

/// <summary>
/// Initializes a new instance of the FormatException class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error. </param>
public FormatException(String message)
: base(message)
{
}

/// <summary>
/// Initializes a new instance of the FormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">The error message that explains the reason for the exception. </param>
/// <param name="innerException">The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. </param>
public FormatException(String message, Exception innerException)
: base(message, innerException)
{
}
}
}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.10.4-preview.{height}",
"version": "1.10.5-preview.{height}",
"assemblyVersion": {
"precision": "revision"
},
Expand Down

0 comments on commit 58b00dc

Please sign in to comment.