public void EqualityOperatorShould_Work_OK_For_Protocol_Lines() { ProtocolLine pl1 = new ProtocolLine("Set;tagPath1;tagValue1;192"); ProtocolLine pl2 = new ProtocolLine("Set;tagPath1;tagValue1;192"); Assert.IsTrue(pl1 == pl2); }
public void EqualsShould_Work_For_Equal_Protocol_Lines() { ProtocolLine pl1 = new ProtocolLine("Set;tagPath1;tagValue1;192"); ProtocolLine pl2 = new ProtocolLine("Set;tagPath1;tagValue1;192"); Assert.IsTrue(pl1.Equals(pl2)); }
private void SetSingleTagFromProtocol(ProtocolLine protocolLine) { opcWriter.WriteSingleTag(new OpcTag(protocolLine.TagPath, protocolLine.TagValue, OpcTagQualityFromInteger(protocolLine.TagQualityInt))); IncrementCurrentProtocolLine(); FillOpcDataGrid(opcReader.ReadAllTags()); }
public void ConstructorShould_Parse_Valid_Protocol_Line_With_Blanks() { ProtocolLine protocolLine = new ProtocolLine("Set; tagPath; tagValue; 192"); Assert.AreEqual(ProtocolLine.Actions.Set, protocolLine.Action); Assert.AreEqual("tagPath", protocolLine.TagPath); Assert.AreEqual("tagValue", protocolLine.TagValue); Assert.AreEqual("192", protocolLine.TagQualityInt); }
public void Append(ProtocolLine protocolLine) { lines.Add(protocolLine); if (null != OnProtocolLineAdded) { OnProtocolLineAdded(this, new ProtocolLineAddedArgs(protocolLine)); } }
private void CheckExpectedTagFromProtocol(ProtocolLine protocolLine) { List <OpcTag> opcTagList = opcReader.ReadAllTags(); OpcTag.OpcTagQuality qualityFromInt = (OpcTag.OpcTagQuality)Convert.ToInt32(protocolLine.TagQualityInt); OpcTag tagToCheck = new OpcTag(protocolLine.TagPath, protocolLine.TagValue, qualityFromInt); if (opcTagList.Contains(tagToCheck)) { FillOpcDataGrid(opcTagList); IncrementCurrentProtocolLine(); } }
public void EqualsShould_Work_For_UnEqual_Protocol_Lines() { ProtocolLine pl1 = new ProtocolLine("Set;tagPath1;tagValue1;192"); ProtocolLine pl2 = new ProtocolLine("Dummy;tagPath1;tagValue1;192"); Assert.IsFalse(pl1.Equals(pl2)); pl2 = new ProtocolLine("Set;tagPath2;tagValue1;192"); Assert.IsFalse(pl1.Equals(pl2)); pl2 = new ProtocolLine("Set;tagPath1;tagValue2;192"); Assert.IsFalse(pl1.Equals(pl2)); pl2 = new ProtocolLine("Set;tagPath1;tagValue1;0"); Assert.IsFalse(pl1.Equals(pl2)); pl2 = new ProtocolLine("Dummy;tagPath1;tagValue1;0"); Assert.IsFalse(pl1.Equals(pl2)); }
private void ExecuteProtocolLine() { string lineToExecute = tbProtocol.Lines[currentProtocolLine]; try { ProtocolLine protocolLine = new ProtocolLine(lineToExecute); switch (protocolLine.Action) { case ProtocolLine.Actions.Set: { SetSingleTagFromProtocol(protocolLine); break; } case ProtocolLine.Actions.Wait: { CheckExpectedTagFromProtocol(protocolLine); break; } case ProtocolLine.Actions.Dummy: { IncrementCurrentProtocolLine(); break; } default: break; } } catch (ProtocolActionException) { MessageBox.Show("Invalid protocol action for line: " + lineToExecute); } }
public ProtocolLineAddedArgs(ProtocolLine addedProtocolLine) { AddedProtocolLine = addedProtocolLine; }
private void CheckExpectedTagFromProtocol(ProtocolLine protocolLine) { List<OpcTag> opcTagList = opcReader.ReadAllTags(); OpcTag.OpcTagQuality qualityFromInt = (OpcTag.OpcTagQuality)Convert.ToInt32(protocolLine.TagQualityInt); OpcTag tagToCheck = new OpcTag(protocolLine.TagPath, protocolLine.TagValue, qualityFromInt); if (opcTagList.Contains(tagToCheck)) { FillOpcDataGrid(opcTagList); IncrementCurrentProtocolLine(); } }
public void ToStringWithoutParametersShould_Produce_Semicolon_Separated_String() { ProtocolLine protocolLine = new ProtocolLine("Set;tagPath;tagValue;192"); Assert.AreEqual("Set;tagPath;tagValue;192", protocolLine.ToString()); }
public void UnknownActionShould_Cause_A_ProtocolActionException() { ProtocolLine protocolLine = new ProtocolLine("UnSet; tagPath; tagValue; 192"); }
public void WhitespacesOnlyProtocolLineShould_Cause_An_ArgumentException() { ProtocolLine protocolLine = new ProtocolLine(" \t"); }
public void InvalidLineShould_Cause_An_IndexOutOfRangeException() { ProtocolLine protocolLine = new ProtocolLine("Set; tagPath; tagValue"); }
public void NotEqualOperatorShould_Work_For_Unequal_Protocol_Lines() { ProtocolLine pl1 = new ProtocolLine("Set;tagPath1;tagValue1;192"); ProtocolLine pl2 = new ProtocolLine("Dummy;tagPath1;tagValue1;192"); Assert.IsTrue(pl1 != pl2); }
public void DummyShould_Be_A_Valid_Contructor_Parameter() { ProtocolLine protocolLine = new ProtocolLine("Dummy"); }
public void EmptyProtocolLineShould_Cause_An_ArgumentExceptionn() { ProtocolLine protocolLine = new ProtocolLine(string.Empty); }