Example #1
0
 public void ParseComp()
 {
     foreach (var val in Cinstruction_Accessor._compCodes)
     {
         string contents = Cinstruction_Accessor.ParseComp(val.Key);
         Assert.AreEqual(val.Value, contents);
     }
 }
Example #2
0
        public void ParseDestTest()
        {
            int Mbit = 1;
            int Dbit = 2;
            int Abit = 4;

            Assert.AreEqual(Mbit, ToInt(Cinstruction_Accessor.ParseDest("M")));
            Assert.AreEqual(Dbit, ToInt(Cinstruction_Accessor.ParseDest("D")));
            Assert.AreEqual(Abit, ToInt(Cinstruction_Accessor.ParseDest("A")));
        }
Example #3
0
 public void ParseDestInvalidLong()
 {
     try
     {
         Cinstruction_Accessor.ParseDest("ADDAM");
         Assert.Fail();
     }
     catch (System.FormatException fe)
     {
     }
 }
Example #4
0
 public void ParseJumpInvalidShortVal()
 {
     try
     {
         Cinstruction_Accessor.ParseJump("ab");
         Assert.Fail();
     }
     catch (System.FormatException fe)
     {
     }
 }
Example #5
0
 public void ParseCompTestInvalid()
 {
     try
     {
         Cinstruction_Accessor.ParseComp("abcd");
         Assert.Fail();
     }
     catch (System.FormatException fe)
     {
     }
 }
Example #6
0
 public void ParseDestInvalidValLowercase()
 {
     try
     {
         Cinstruction_Accessor.ParseDest("mda");
         Assert.Fail();
     }
     catch (System.FormatException fe)
     {
     }
 }