Ejemplo n.º 1
0
 public ResultSrv <long> CommentBusiness()
 {
     try
     {
         var output            = new ResultSrv <long>();
         var commentBusinessVo = CommentBusinessVo.ConcreteBuilder
                                 .SetServiceCallParameters(internalServiceCallVo)
                                 .SetBusinessId(0)
                                 .SetText("jsj")
                                 .Build();
         DealingService.CommentBusiness(commentBusinessVo, 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 CommentBusiness_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 <long>();
            var commentBusinessVo = CommentBusinessVo.ConcreteBuilder
                                    .SetServiceCallParameters(internalServiceCallVo)
                                    .SetBusinessId(13059)
                                    .SetText("test Comment")
                                    .Build();

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