forked from CosmosOS/Cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request CosmosOS#914 from CosmosOS/convert-tests
Fixed Convert and added tests
- Loading branch information
Showing
4 changed files
with
34 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
|
||
using Cosmos.TestRunner; | ||
|
||
namespace Cosmos.Compiler.Tests.Bcl.System | ||
{ | ||
internal static class ConvertTests | ||
{ | ||
public static void Execute() | ||
{ | ||
var number = 5; | ||
var numberToString = Convert.ToString(number); | ||
|
||
Assert.IsTrue(numberToString == "5", $"Convert.ToString(Int32) doesn't work. Result: {numberToString}"); | ||
|
||
var numberToByte = Convert.ToByte(number); | ||
|
||
Assert.IsTrue(numberToByte == 5, $"Convert.ToByte(Int32) doesn't work. Result: {numberToByte}"); | ||
|
||
var byteToSingle = Convert.ToSingle(numberToByte); | ||
|
||
Assert.IsTrue(EqualityHelper.SinglesAreEqual(byteToSingle, 5.0f), $"Convert.ToSingle(Byte) doesn't work. Result: {byteToSingle}"); | ||
|
||
var numberToBase64 = Convert.ToBase64String(BitConverter.GetBytes(number)); | ||
|
||
Assert.IsTrue(numberToBase64 == "BQAAAA==", $"Convert.ToBase64String(byte[]) doesn't work. Result: {numberToBase64}"); | ||
} | ||
} | ||
} |
8 changes: 2 additions & 6 deletions
8
...e/Archive/Old System Plugs/DecimalImpl.cs → ...osmos.System2_Plugs/System/DecimalImpl.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters