Dictionary test

This commit is contained in:
kaleb 2016-12-02 20:00:09 +10:00
parent 25f77c5e18
commit ef489b0f2f
3 changed files with 21 additions and 2 deletions

View file

@ -15,10 +15,27 @@ namespace Cosmos.Compiler.Tests.Bcl.System.Collections.Generic
{
{"echo", "ECHO"},
{"reboot", "REBOOT" },
{"shutdown", "SHUTDOWN"}
{"shutdown", "SHUTDOWN"},
{"integer", 500}
};
Assert.IsTrue(commands.ContainsKey("echo"), "Dictionary ContainsKey does not work");
Assert.IsTrue(commands.ContainsKey("echo"), "Dictionary ContainsKey does not work1");
Assert.IsFalse(commands.ContainsKey("musterror"), "Dictionary ContainsKey does not work 2");
//String test
Assert.IsTrue((string)commands["echo"] == "ECHO", "Dictionary string not work");
commands["echo"] = "notEcho";
Assert.IsTrue((string)commands["echo"] == "notEcho", "Dictionary string been reset not working");
//Integer test
Assert.IsTrue((int)commands["integer"] == 500, "Dictionary integer not working");
commands["integer"] = 321;
Assert.IsTrue((int)commands["integer"] == 321, "Dictionary integer been reset not working");
}
}
}

View file

@ -88,6 +88,7 @@
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="System\Collections\Generic\DictionaryImpI.cs" />
<Compile Include="System\Collections\Generic\EqualityComparerImpl.cs" />
<Compile Include="System\DecimalImpl.cs" />
<Compile Include="System\Mda.cs" />

View file

@ -9,6 +9,7 @@ namespace Cosmos.System.Plugs.System.Collections.Generic
{
public static EqualityComparer<T> CreateComparer()
{
throw new Exception("Create comparer not yet implemented!");
}
}