예제 #1
0
        public async Task CheckNodeStatus_200_ReturnsResponse()
        {
            // Arrange
            var nodeStatus = new NodeStatus
            {
                ExternalAddress = "192.0.0.1",
                Network         = "CirrusMain",
                State           = "Started"
            };

            _httpTest.RespondWithJson(nodeStatus, status: 200);

            // Act
            var result = await _nodeService.CheckNodeStatus();

            // Assert
            var expected = JsonConvert.SerializeObject(nodeStatus);
            var actual   = JsonConvert.SerializeObject(result);

            Assert.That(actual, Is.EqualTo(expected));
        }
        private async void PollNodeHealthAsync(object state)
        {
            var nodeStatus = await _nodeService.CheckNodeStatus();

            OnNodeStatusUpdated?.Invoke(this, new NodeDetailsEventArgs(nodeStatus));
        }