Beispiel #1
0
 public ResultSrv <SubscriptionSrv> ConsumeSubscription()
 {
     try
     {
         var output = new ResultSrv <SubscriptionSrv>();
         var consumeSubscriptionVo = ConsumeSubscriptionVo.ConcreteBuilder
                                     .SetServiceCallParameters(internalServiceCallVo)
                                     .SetId(0)
                                     .SetUsedAmount(5)
                                     .Build();
         SubscriptionService.ConsumeSubscription(consumeSubscriptionVo, 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;
     }
 }
        public void ConsumeSubscription_AllParameters()
        {
            var internalServiceCallVo = InternalServiceCallVo.ConcreteBuilder
                                        .SetToken("0469eba2ddf84cb49eff254fe353638d")
                                        .Build();

            var output = new ResultSrv <SubscriptionSrv>();
            var consumeSubscriptionVo = ConsumeSubscriptionVo.ConcreteBuilder
                                        .SetServiceCallParameters(internalServiceCallVo)
                                        .SetId(0)
                                        .SetUsedAmount(5)
                                        .Build();

            SubscriptionService.ConsumeSubscription(consumeSubscriptionVo,
                                                    response => Listener.GetResult(response, out output));
            Assert.False(output.HasError);
        }