| 1 | using System;
|
|---|
| 2 | using System.Collections.Generic;
|
|---|
| 3 | using System.Text;
|
|---|
| 4 |
|
|---|
| 5 | namespace IndianHealthService.BMXNet.Tests
|
|---|
| 6 | {
|
|---|
| 7 | internal class BMXNetScriptedBroker : BMXNetBroker
|
|---|
| 8 | {
|
|---|
| 9 |
|
|---|
| 10 | /*
|
|---|
| 11 | public override string GetLoginFacility(String aDuz)
|
|---|
| 12 | {
|
|---|
| 13 | throw new NotImplementedException();
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | public override bool IsConnected
|
|---|
| 17 | {
|
|---|
| 18 | get { return true; }
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | private List<Call> _calls = new List<Call>();
|
|---|
| 22 |
|
|---|
| 23 | private List<Call> Calls
|
|---|
| 24 | {
|
|---|
| 25 | get { return _calls; }
|
|---|
| 26 | set { _calls = value; }
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | public void AddCall(String request, String response)
|
|---|
| 30 | {
|
|---|
| 31 | Call call = new Call();
|
|---|
| 32 | call.Request = request;
|
|---|
| 33 | call.Response = response;
|
|---|
| 34 | this.Calls.Add(call);
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | protected override string SendReceiveString(string sendString, string multi)
|
|---|
| 38 | {
|
|---|
| 39 | if (this.Calls.Count == 0)
|
|---|
| 40 | {
|
|---|
| 41 | throw new Exception("No more calls in script.");
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | if (this.Calls[0].Request.Equals(sendString))
|
|---|
| 45 | {
|
|---|
| 46 | Call hit = this.Calls[0];
|
|---|
| 47 | this.Calls.Remove(hit);
|
|---|
| 48 | return hit.Response;
|
|---|
| 49 | }
|
|---|
| 50 | else
|
|---|
| 51 | {
|
|---|
| 52 | throw new Exception("Unexpected call: " + sendString);
|
|---|
| 53 | }
|
|---|
| 54 | }
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
| 57 | */
|
|---|
| 58 |
|
|---|
| 59 | class Call
|
|---|
| 60 | {
|
|---|
| 61 |
|
|---|
| 62 | private String _request = null;
|
|---|
| 63 |
|
|---|
| 64 | public String Request
|
|---|
| 65 | {
|
|---|
| 66 | get { return _request; }
|
|---|
| 67 | set { _request = value; }
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | private String _response = null;
|
|---|
| 71 |
|
|---|
| 72 | public String Response
|
|---|
| 73 | {
|
|---|
| 74 | get { return _response; }
|
|---|
| 75 | set { _response = value; }
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | }
|
|---|
| 79 |
|
|---|
| 80 | public override bool IsConnected
|
|---|
| 81 | {
|
|---|
| 82 | get { throw new NotImplementedException(); }
|
|---|
| 83 | }
|
|---|
| 84 |
|
|---|
| 85 | public override RemoteSession PrimaryRemoteSession
|
|---|
| 86 | {
|
|---|
| 87 | get { throw new NotImplementedException(); }
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | public override void Close()
|
|---|
| 91 | {
|
|---|
| 92 | throw new NotImplementedException();
|
|---|
| 93 | }
|
|---|
| 94 |
|
|---|
| 95 | public override RemoteSessionPool RemoteSessionPool
|
|---|
| 96 | {
|
|---|
| 97 | get { throw new NotImplementedException(); }
|
|---|
| 98 | }
|
|---|
| 99 |
|
|---|
| 100 | internal void AddCall(string p, string p_2)
|
|---|
| 101 | {
|
|---|
| 102 | throw new NotImplementedException();
|
|---|
| 103 | }
|
|---|
| 104 | }
|
|---|
| 105 | }
|
|---|