public void ActJavaElementAction() { //Arrange ActJavaElement act = new ActJavaElement(); act.WaitforIdle = ActJavaElement.eWaitForIdle.Medium; act.LocateBy = eLocateBy.ByName; act.LocateValue = "ABC"; act.Value = "123"; act.ControlAction = ActJavaElement.eControlAction.SetValue; //Act PayLoad pl = act.Pack(); byte[] b = pl.GetPackage(); PayLoad pl2 = new PayLoad(b); pl2.DumpToConsole(); string WaitForIdle = pl2.GetValueEnum(); string LocateBy = pl2.GetValueEnum(); string LocateValue = pl2.GetValueString(); string Value = pl2.GetValueString(); string ControlAction = pl2.GetValueEnum(); //Assert Assert.AreEqual(act.LocateBy.ToString(), LocateBy); Assert.AreEqual(act.LocateValue, LocateValue); Assert.AreEqual(act.Value, Value); Assert.AreEqual(act.ControlAction.ToString(), ControlAction); }
public void ComplexEnumStringsInts() { //Arrange int vala = 123; int valb = 545; string valsa = "String1"; string valsb = "ZXCVFDSW"; eLocateBy loc = eLocateBy.ByName; PayLoad pl = new PayLoad("ComplexEnumStringsInts"); pl.AddValue(vala); pl.AddValue(valb); pl.AddValue(valsa); pl.AddValue(valsb); pl.AddEnumValue(loc); pl.ClosePackage(); // Act byte[] b = pl.GetPackage(); PayLoad pl2 = new PayLoad(b); int vala2 = pl2.GetValueInt(); int valb2 = pl2.GetValueInt(); string valsa2 = pl2.GetValueString(); string valsb2 = pl2.GetValueString(); string Loc2 = pl2.GetValueEnum(); //Assert Assert.AreEqual(vala, vala2); Assert.AreEqual(valb, valb2); Assert.AreEqual(valsa, valsa2); Assert.AreEqual(valsb, valsb2); Assert.AreEqual(loc.ToString(), Loc2); }