public void NodeService_CanRetrieveNodeId() { var nodeId = 1; var nodeService = new NodeService(nodeId); Assert.AreEqual(nodeService.NodeId, nodeId); }
public void NodeService_CanBePinged() { var nodeId = 1; var nodeService = new NodeService(nodeId); nodeService.Ping(); }
/// <summary> /// Creates a DHT node service /// </summary> /// <param name="nodeId">The id of the node</param> /// <param name="endpoint">The endpoint to run on</param> /// <returns></returns> public static INodeService CreateNodeService(int nodeId, Uri endpoint) { // TODO Should ping the endpoint and check there is no node existing on that endpoint var nodeInstance = new NodeService(nodeId); var host = new WebServiceHost(nodeInstance, endpoint); host.Open(); return nodeInstance; }
public void NodeService_CanCreate() { var nodeService = new NodeService(1); Assert.IsNotNull(nodeService); }