Ejemplo n.º 1
0
 public ResultSrv <RateSrv> RateBusiness()
 {
     try
     {
         var output         = new ResultSrv <RateSrv>();
         var rateBusinessVo = RateBusinessVo.ConcreteBuilder
                              .SetServiceCallParameters(internalServiceCallVo)
                              .SetBusinessId(0)
                              .SetRate(4)
                              .Build();
         DealingService.RateBusiness(rateBusinessVo, response => Listener.GetResult(response, out output));
         return(output);
     }
     catch (PodException podException)
     {
         Console.WriteLine(
             $"-- {podException.Code}-an error has occured : {Environment.NewLine}{podException.Message}");
         throw;
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.Message);
         throw;
     }
 }
Ejemplo n.º 2
0
        public void RateBusiness_RequiredParameters()
        {
            var clientInfo = new ClientInfo
            {
                ClientId     = "6305557f7fcb4988abae4e404d3e6e1d",
                ClientSecret = "a8ba06d0"
            };

            var ssoService = new SsoService(clientInfo);

            var outputToken    = new OAuthResponseSrv();
            var refreshTokenVo = RefreshAccessTokenVo.ConcreteBuilder
                                 .SetGrantType("refresh_token")
                                 .SetRefreshToken("077372c5cbc9429086ec37f50e2f898c")
                                 .Build();

            ssoService.RefreshAccessToken(refreshTokenVo, response => Listener.GetResult(response, out outputToken));

            var internalServiceCallVo = InternalServiceCallVo.ConcreteBuilder
                                        .SetToken(outputToken.Access_Token)
                                        .Build();

            var output         = new ResultSrv <RateSrv>();
            var rateBusinessVo = RateBusinessVo.ConcreteBuilder
                                 .SetServiceCallParameters(internalServiceCallVo)
                                 .SetBusinessId(13059)
                                 .SetRate(4)
                                 .Build();

            DealingService.RateBusiness(rateBusinessVo, response => Listener.GetResult(response, out output));
            Assert.False(output.HasError);
        }