コード例 #1
0
        public void TestLoginFail()
        {
            IService service = ServiceFactory.getInstance().getService(service_type.USER_LOGIN);
            UserLoginRequest serviceRequest = new UserLoginRequest();

            serviceRequest.username = "******";
            serviceRequest.password = "******";



            ServiceRequest request = new ServiceRequest(serviceRequest);
            ServiceResponse response = new ServiceResponse();
            service.process(request, response);

            Assert.AreEqual(-1, response.returnCode);
           
        }
コード例 #2
0
        public void TestLoginSuccess()
        {
            IService service = ServiceFactory.getInstance().getService(service_type.USER_LOGIN);
            UserLoginRequest serviceRequest = new UserLoginRequest();

            serviceRequest.username = "******";
            serviceRequest.password = "******";
        


            ServiceRequest request = new ServiceRequest(serviceRequest);
            ServiceResponse response = new ServiceResponse();
            service.process(request, response);

            Assert.AreEqual(0, response.returnCode);
            Assert.IsTrue(7 == ((UserLoginResponse)response.responseObj).userId);
            
        }