public void AddSubscriptionPlan_AllParameters() { var internalServiceCallVo = InternalServiceCallVo.ConcreteBuilder .SetToken("0469eba2ddf84cb49eff254fe353638d") .Build(); var output = new ResultSrv <SubscriptionPlanSrv>(); var addSubscriptionPlanVo = AddSubscriptionPlanVo.ConcreteBuilder .SetServiceCallParameters(internalServiceCallVo) .SetName("tstn") .SetPrice(100) .SetPeriodTypeCode(PeriodType.SUBSCRIPTION_PLAN_PERIOD_TYPE_DAILY) .SetPeriodTypeCount(2) .SetType(SubscriptionType.SUBSCRIPTION_PLAN_TYPE_BLOCK) .SetGuildCode("TOILETRIES_GUILD") .SetEntityId(19482) .SetUsageCountLimit(0) .SetUsageAmountLimit(100.9M) .SetPermittedGuildCode(new string[] { "ADVERTISEMENT_GUILD", "TOILETRIES_GUILD" }) .SetPermittedBusinessId(new long[] { 3605, 3612 }) .SetPermittedProductId(new long[] { }) .SetCurrencyCode("") .Build(); SubscriptionService.AddSubscriptionPlan(addSubscriptionPlanVo, response => Listener.GetResult(response, out output)); Assert.False(output.HasError); }
public void AddSubscriptionPlan_RequiredParameters() { var internalServiceCallVo = InternalServiceCallVo.ConcreteBuilder .SetToken("0469eba2ddf84cb49eff254fe353638d") .Build(); var output = new ResultSrv <SubscriptionPlanSrv>(); var addSubscriptionPlanVo = AddSubscriptionPlanVo.ConcreteBuilder .SetServiceCallParameters(internalServiceCallVo) .SetName("tstn") .SetPrice(100) .SetPeriodTypeCode(PeriodType.SUBSCRIPTION_PLAN_PERIOD_TYPE_DAILY) .SetPeriodTypeCount(2) .SetType(SubscriptionType.SUBSCRIPTION_PLAN_TYPE_BLOCK) .SetGuildCode("TOILETRIES_GUILD") .SetEntityId(19482) .Build(); SubscriptionService.AddSubscriptionPlan(addSubscriptionPlanVo, response => Listener.GetResult(response, out output)); Assert.False(output.HasError); }
public ResultSrv <SubscriptionPlanSrv> AddSubscriptionPlan() { try { var output = new ResultSrv <SubscriptionPlanSrv>(); var addSubscriptionPlanVo = AddSubscriptionPlanVo.ConcreteBuilder .SetServiceCallParameters(internalServiceCallVo) .SetName("") .SetPrice(100) .SetPeriodTypeCode(PeriodType.SUBSCRIPTION_PLAN_PERIOD_TYPE_DAILY) .SetPeriodTypeCount(2) .SetType(SubscriptionType.SUBSCRIPTION_PLAN_TYPE_BLOCK) .SetGuildCode("TOILETRIES_GUILD") .SetEntityId(0) //Optional .SetUsageCountLimit(0) .SetUsageAmountLimit(100.9M) .SetPermittedGuildCode(new string[] { "ADVERTISEMENT_GUILD", "TOILETRIES_GUILD" }) .SetPermittedBusinessId(new long[] { 0, 0 }) //.SetPermittedProductId(new long[]{}) //.SetCurrencyCode("") .Build(); SubscriptionService.AddSubscriptionPlan(addSubscriptionPlanVo, 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; } }