Cosmos/Tests/BoxingTests/Kernel.cs
Charles Betros 2e4e0dd370 Added a test kernel for boxing.
Moved Char Plug to Cosmos.System.Plugs
Added FAT writing. (Doesn't work yet.)
2015-07-24 17:52:44 -05:00

51 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using Cosmos.TestRunner;
using Sys = Cosmos.System;
namespace BoxingTests
{
public class Kernel : Sys.Kernel
{
protected override void BeforeRun()
{
Console.WriteLine("Cosmos booted successfully.");
}
protected override void Run()
{
Assert.IsTrue(TestBoxingCharToString(), "Boxing char to string test failed.");
Assert.IsTrue(TestBoxingCharArrayToString(), "Boxing char[] to string test failed.");
TestController.Completed();
}
private bool TestBoxingCharToString()
{
try
{
char xC = 'c';
string xS = xC.ToString();
return (xS[0] == xC);
}
catch (Exception)
{
return false;
}
}
private bool TestBoxingCharArrayToString()
{
try
{
char[] xC = {'c'};
string xS = xC.ToString();
return (xS[0] == xC[0]);
}
catch (Exception)
{
return false;
}
}
}
}