コード例 #1
0
        public void Authentication_HrApi_Pass_Return200()
        {
            //Arrage
            string empid    = "TEST";
            string password = "******";

            HttpCallResult httpCallResult = new HttpCallResult
            {
                StatusCode    = "200",
                FaultInfo     = null,
                ReturnContent = "[{\"NAME_AC\": \"ESURENA RACHEL DOMINGUEZ\",\"Z_SITE_ID\": \"WIH\",\"status\": true}]"
            };

            _restfulApiClient.Post(Arg.Any <string>(), Arg.Any <Dictionary <string, string> >(), Arg.Any <string>()).Returns(httpCallResult);

            HrIdentityResponse expectedResponse = new HrIdentityResponse
            {
                Name_Ac   = "ESURENA RACHEL DOMINGUEZ",
                Z_Site_ID = "WIH",
                Status    = true
            };

            //Act
            HrIdentityResponse actualResponse = _targetObj.Authentication(empid, password);

            //Assert
            Assert.AreEqual(expectedResponse.Name_Ac, actualResponse.Name_Ac);
            Assert.AreEqual(expectedResponse.Z_Site_ID, actualResponse.Z_Site_ID);
            Assert.AreEqual(expectedResponse.Status, actualResponse.Status);
        }
コード例 #2
0
ファイル: AuthService.cs プロジェクト: Gary418Wu/AppStore-MVC
 public HrIdentityResponse IdentityByHr(string userId, string password)
 {
     return(_hrProxy.Authentication(userId, password));
 }