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); }
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); }
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); } }
public HomeBusinessObject() : base() { _nodeDAO = new NodesDataAccessObject(); }
public NodesBusinessObject() : base() { _nodeDAO = new NodesDataAccessObject(); _reqService = new RequesterService(); _reqProducer = new ProducerService(); }
public DeploymentBusinessObject() : base() { _nodeDAO = new NodesDataAccessObject(); }