public Drivers.CommunicationProtocol.PayLoad GetPayLoad() { string payLoadName = @"UIElementAction"; if (Convert.ToBoolean(this.GetInputParamValue(Fields.IsWidgetsElement))) { payLoadName = @"WidgetsUIElementAction"; } PayLoad PL = new PayLoad(payLoadName); // Make it generic function in Act.cs to be used by other actions List <PayLoad> PLParams = new List <PayLoad>(); foreach (ActInputValue AIV in this.InputValues) { if (!string.IsNullOrEmpty(AIV.Value)) { PayLoad AIVPL = new PayLoad("AIV", AIV.Param, AIV.ValueForDriver); PLParams.Add(AIVPL); } } PL.AddListPayLoad(PLParams); PL.ClosePackage(); return(PL); }
public Drivers.CommunicationProtocol.PayLoad GetPayLoad() { PayLoad PL = new PayLoad("UIElementAction"); // Make it generic function in Act.cs to be used by other actions List <PayLoad> PLParams = new List <PayLoad>(); foreach (ActInputValue AIV in this.InputValues) { if (!string.IsNullOrEmpty(AIV.Value)) { PayLoad AIVPL = new PayLoad("AIV", AIV.Param, AIV.ValueForDriver); PLParams.Add(AIVPL); } } PL.AddListPayLoad(PLParams); PL.ClosePackage(); return(PL); }
public void PayLoadList() { //Arrange PayLoad pl = new PayLoad("Package wth list of Payloads"); List <PayLoad> list = new List <PayLoad>(); PayLoad pl1 = new PayLoad("PL1"); pl1.AddValue("ABC"); pl1.AddValue("DEF"); pl1.ClosePackage(); list.Add(pl1); PayLoad pl2 = new PayLoad("PL2"); pl2.AddValue("GHI"); pl2.AddValue("JKL"); pl2.ClosePackage(); list.Add(pl2); pl.AddListPayLoad(list); pl.ClosePackage(); // Act byte[] b = pl.GetPackage(); PayLoad plc = new PayLoad(b); List <PayLoad> list2 = plc.GetListPayLoad(); //Assert Assert.AreEqual(2, list2.Count, "list2.Count=2"); Assert.AreEqual("PL1", list2[0].Name, "list2[0].Name =PL1"); Assert.AreEqual("PL2", list2[1].Name, "list2[1].Name =PL2"); //Assert.AreEqual(pl1.Name, pl2.Name); }
internal Drivers.CommunicationProtocol.PayLoad GetPayLoad() { PayLoad PL = new PayLoad("UIElementAction"); PL.AddValue(this.ElementLocateBy.ToString()); PL.AddValue(GetOrCreateInputParam(Fields.ElementLocateValue).ValueForDriver); // Need Value for driver PL.AddValue(this.ElementType.ToString()); PL.AddValue(this.ElementAction.ToString()); // Make it generic function in Act.cs to be used by other actions List <PayLoad> PLParams = new List <PayLoad>(); foreach (ActInputValue AIV in this.InputValues) { if (!string.IsNullOrEmpty(AIV.Value)) { PayLoad AIVPL = new PayLoad("AIV", AIV.Param, AIV.ValueForDriver); PLParams.Add(AIVPL); } } PL.AddListPayLoad(PLParams); PL.ClosePackage(); return(PL); }