示例#1
0
        public void Validate(SetTradingSessionRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            if (string.IsNullOrEmpty(request.SessionId))
            {
                throw new ArgumentNullException("SessionId");
            }
        }
示例#2
0
        public void ValidateSetTradingSessionRequest()
        {
            // Null.
            {
                var v = new SessionProviderValidator();
                SetTradingSessionRequest r = null;

                AssertEx.Throws <ArgumentNullException>(() =>
                {
                    v.Validate(r);
                });
            }

            // SessionId null.
            {
                var v = new SessionProviderValidator();
                SetTradingSessionRequest r = new SetTradingSessionRequest();
                r.SessionId = null;

                AssertEx.Throws <ArgumentNullException>(() =>
                {
                    v.Validate(r);
                });
            }

            // SessionId empty.
            {
                var v = new SessionProviderValidator();
                SetTradingSessionRequest r = new SetTradingSessionRequest();
                r.SessionId = "";

                AssertEx.Throws <ArgumentNullException>(() =>
                {
                    v.Validate(r);
                });
            }

            // Valid.
            {
                var v = new SessionProviderValidator();
                SetTradingSessionRequest r = new SetTradingSessionRequest();
                r.SessionId = "qwerty";

                v.Validate(r);
            }
        }
示例#3
0
        public void SetTradingSession(SetTradingSessionRequest request)
        {
            this.Validator.Validate(request);

            this.FxSession.setTradingSession(request.SessionId, request.Pin == null ? string.Empty : request.Pin);
        }
示例#4
0
 public void SetTradingSession(SetTradingSessionRequest request)
 {
     throw new NotImplementedException();
 }