public async Task <OperationResult <List <RequesterPOCO> > > GetAllRequestersAsync()
 {
     return(await ExecuteFunction(async() =>
     {
         var nodeList = await _nodeDAO.GetAllRequestersAsync();
         foreach (var it in nodeList)
         {
             await _reqService.FetchValues(it);
         }
         nodeList.RemoveAll(it => it.State == "No sidechain");
         return nodeList;
     }));
 }
Пример #2
0
        public async Task TestGetRequesters()
        {
            var inDB = new List <RequesterPOCO> {
                new RequesterPOCO {
                    Account = "Full", Ip = "Mock"
                },
                new RequesterPOCO {
                    Account = "Requester", Ip = "Mock"
                }
            };
            var nodesDAO = new NodesDataAccessObject();

            nodesDAO.TestDB();
            var allnodes = await nodesDAO.GetAllRequestersAsync();

            var b = allnodes.SequenceEqual(inDB);

            Assert.IsTrue(b);
        }