Esempio n. 1
0
        public async Task TestGetProducers()
        {
            var inDB = new List <ProducerPOCO> {
                new ProducerPOCO {
                    Account = "Full", Ip = "Mock", Type = "Full"
                },
                new ProducerPOCO {
                    Account = "Producer", Ip = "Mock", Type = "Producer",
                }
            };
            var nodesDAO = new NodesDataAccessObject();

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

            var b = allnodes.SequenceEqual(inDB);

            Assert.IsTrue(b);
        }
Esempio n. 2
0
        public async Task TestGetAllNodes()
        {
            var inDB = new List <Node> {
                new Node {
                    Account = "Full", Ip = "Mock", Service = "Mock", Type = "Full", Status = "ON"
                },
                new Node {
                    Account = "Requester", Ip = "Mock", Service = "Mock", Type = "Requester", Status = "ON"
                },
                new Node {
                    Account = "Producer", Ip = "Mock", Service = "Mock", Type = "Producer", Status = "ON"
                }
            };
            var nodesDAO = new NodesDataAccessObject();

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

            var b = allnodes.SequenceEqual(inDB);

            Assert.IsTrue(b);
        }
Esempio n. 3
0
        public async Task SetStatusNode()
        {
            try
            {
                var inDB = new List <Node> {
                    new Node {
                        Account = "Requester", Ip = "Mock", Service = "Mock", Type = "Requester", Status = "OFF"
                    },
                };
                var nodesDAO = new NodesDataAccessObject();
                nodesDAO.TestDB();
                await nodesDAO.StopNodeAsync("Requester");

                var node = await nodesDAO.GetNodeAsync("Requester");

                await nodesDAO.StartNodeAsync("Requester");

                Assert.IsTrue(node.Status == "OFF");
            }
            catch (Exception e)
            {
                Assert.IsTrue(false);
            }
        }
Esempio n. 4
0
 public HomeBusinessObject() : base()
 {
     _nodeDAO = new NodesDataAccessObject();
 }
 public NodesBusinessObject() : base()
 {
     _nodeDAO     = new NodesDataAccessObject();
     _reqService  = new RequesterService();
     _reqProducer = new ProducerService();
 }
Esempio n. 6
0
 public DeploymentBusinessObject() : base()
 {
     _nodeDAO = new NodesDataAccessObject();
 }