public void TestCaseNormal(string input, int expected) { var plc = new Plc(); plc.BitDevices["R0"] = true; plc.WordDevices["DM0"] = 10; plc.WordDevices["DM10"] = 0; Console.WriteLine(PLCSimulator.Execute(plc, input)); Assert.AreEqual(expected, plc.WordDevices["DM10"]); }
public void TestCaseIndexDevice(string input, int expected1) { Plc plc = new Plc(); plc.BitDevices["R0"] = true; plc.WordDevices["DM0"] = 10; plc.WordDevices["DM20"] = 3; plc.WordDevices["DM13"] = 0; Console.WriteLine(PLCSimulator.Execute(plc, input)); Assert.AreEqual(expected1, plc.WordDevices["DM13"]); }