Skip to content

Commit

Permalink
added more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rbaker26 committed Jun 17, 2020
1 parent c80cec3 commit 80dee8c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SAP1EMU.Engine-CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Options

// TODO - Figure out why default isnt working here
// Default should be "std"
[Option('O', "FOframe", SetName = "FOframe", Required = false, HelpText = "Include Snapshots of the Output Register in the output file.\nParameters:\n std\t\tOutputs with formatting\n no-format\tOutputs wil no formatting")]
[Option('O', "FOfragitme", SetName = "FOframe", Required = false, HelpText = "Include Snapshots of the Output Register in the output file.\nParameters:\n std\t\tOutputs with formatting\n no-format\tOutputs wil no formatting")]
public string FOframe { get; set; }
// ********************************************

Expand Down
4 changes: 2 additions & 2 deletions SAP1EMU.Lib.Test/AssemblerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public void TestParseList_Invalid_Code_3()
#endregion


// Malvino Op Code Loop Detection Test **************************************
// Malvino Op Code Test *****************************************************
[TestMethod]
public void Test_MalvinoCodes_1()
{
Expand Down Expand Up @@ -460,7 +460,7 @@ public void Test_MalvinoCodes_2()
Assemble.Parse(asm, "Malvino");
Assert.Fail();
}
catch (Exception e)
catch (Exception)
{

}
Expand Down
55 changes: 55 additions & 0 deletions SAP1EMU.Lib.Test/InstructionSetTests/InstructionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using NuGet.Frameworks;

namespace SAP1EMU.Lib.Test.InstructionSetTests
{
[TestClass]
public class InstructionTests
{

[TestMethod]
public void TestInstruction()
{
try
{
Instruction i = new Instruction();
}
catch (Exception e)
{
Assert.Fail(e.ToString());
}
}

[TestMethod]
public void TestInstructionSet()
{
try
{
InstructionSet i = new InstructionSet();
}
catch (Exception e)
{
Assert.Fail(e.ToString());
}
}
[TestMethod]
public void TestopCodeLoader()
{
try
{
OpCodeLoader.GetSet("SAP1Emu");
OpCodeLoader.GetSet("Malvino");
OpCodeLoader.GetSet("BenEater");
}
catch(Exception e)
{
Assert.Fail(e.ToString());
}
}
}
}

0 comments on commit 80dee8c

Please sign in to comment.