public override void ProcessTask() { _Results = new PostResultsRequest(); _Results.Lock = _Task.Lock; // ... }
public AgentAcknowledgeResponse PostResults(PostResultsRequest request) { if (request == null) { throw new ArgumentNullException("request"); } return(InvokeAndCheck <AgentAcknowledgeResponse>(() => DoPostResults(request), "AgentTemplatePostResults")); }
public void PostResultsTest_InputTestMode1_OutputSuccess() { Service x = new Service(); PostResultsRequest req = new PostResultsRequest(); req.Lock = new Guid(); req.TestMode = 1; AgentAcknowledgeResponse resp = x.PostResults(req); Assert.IsInstanceOf(typeof(AgentAcknowledgeResponse), resp); }
public void PostResultsTests_InputTestMode1_OutputSuccess() { WcfSelfHost host = new WcfSelfHost(typeof(Service)); IET.Inspec.Fairburn.AgentTemplate.Task x = new IET.Inspec.Fairburn.AgentTemplate.Task(); var privateObject = new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject(x); x.Initialise(new Host(), 0); PostResultsRequest req = new PostResultsRequest(); req.TestMode = 1; privateObject.SetField("_Results", req); privateObject.Invoke("PostResults"); //privateObject.Invoke("APrivateMethod", new object[] { param1, param2}); -- Call Private method with parameters host.Dispose(); host = null; }
private AgentAcknowledgeResponse DoPostResults(PostResultsRequest request) { using (DatabaseRequest db = new DatabaseRequest(_Db, "AgentTemplatePostResults")) { db.AddParameter("@Lock", request.Lock); if (request.TestMode != 0) { db.AddParameter("@TestMode", request.TestMode); } db.ExecuteNonQuery(); AgentAcknowledgeResponse response = new AgentAcknowledgeResponse(); return(response); } }
public AgentAcknowledgeResponse PostResults(PostResultsRequest request) { return(InvokeAndCheck <AgentAcknowledgeResponse>(() => this.Object.PostResults(request))); }