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); }
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); }