public void ParseComp() { foreach (var val in Cinstruction_Accessor._compCodes) { string contents = Cinstruction_Accessor.ParseComp(val.Key); Assert.AreEqual(val.Value, contents); } }
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"))); }
public void ParseDestInvalidLong() { try { Cinstruction_Accessor.ParseDest("ADDAM"); Assert.Fail(); } catch (System.FormatException fe) { } }
public void ParseJumpInvalidShortVal() { try { Cinstruction_Accessor.ParseJump("ab"); Assert.Fail(); } catch (System.FormatException fe) { } }
public void ParseCompTestInvalid() { try { Cinstruction_Accessor.ParseComp("abcd"); Assert.Fail(); } catch (System.FormatException fe) { } }
public void ParseDestInvalidValLowercase() { try { Cinstruction_Accessor.ParseDest("mda"); Assert.Fail(); } catch (System.FormatException fe) { } }