public ResultSrv <TagTreeSrv> AddTagTree() { try { var output = new ResultSrv <TagTreeSrv>(); var addTagTreeCategoryVo = AddTagTreeVo.ConcreteBuilder .SetServiceCallParameters(internalServiceCallVo) .SetName("tstna18") .SetCategoryId(301) .SetParentId(601) .Build(); BaseService.AddTagTree(addTagTreeCategoryVo, 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 AddTagTree_RequiredParameters() { var internalServiceCallVo = InternalServiceCallVo.ConcreteBuilder .SetToken("0469eba2ddf84cb49eff254fe353638d") .Build(); var output = new ResultSrv <TagTreeSrv>(); var num = new Random().Next(5000); var addTagTreeCategoryVo = AddTagTreeVo.ConcreteBuilder .SetServiceCallParameters(internalServiceCallVo) .SetName($"tst{num}") .SetCategoryId(1507) .Build(); BaseService.AddTagTree(addTagTreeCategoryVo, response => Listener.GetResult(response, out output)); Assert.False(output.HasError); }
public void AddTagTree_InvalidParameters_CategoryId() { try { var internalServiceCallVo = InternalServiceCallVo.ConcreteBuilder .SetToken("0469eba2ddf84cb49eff254fe353638d") //.SetScVoucherHash({Put your VoucherHash}) //.SetScApiKey("") .Build(); var output = new ResultSrv <TagTreeSrv>(); var num = new Random().Next(2000); var addTagTreeCategoryVo = AddTagTreeVo.ConcreteBuilder .SetServiceCallParameters(internalServiceCallVo) .SetName($"tst{num}") .SetCategoryId(0000) //.SetParentId(601) .Build(); BaseService.AddTagTree(addTagTreeCategoryVo, response => Listener.GetResult(response, out output)); } catch (PodException podException) { Assert.True(podException.OriginalResult.HasError); } }