public async void GetNodesActionSuccess() { var controller = new NodesController(fixture.Context); var result = await controller.GetNodes(1); Assert.IsType <OkObjectResult>(result); }
public void GetNodesNotNull() { var controller = new NodesController(fixture.Context); var result = controller.GetNodes(); Assert.NotNull(result); }
public void GetNodes_ReturnsNodesServiceResult() { _nodeServiceMock.Setup(x => x.GetNodes()) .Returns(new[] { new Node { Id = 1, IpOrHostname = "1.1.1.1", PollingMethod = "WMI" }, new Node { Id = 2, IpOrHostname = "2.2.2.2", PollingMethod = "SNMP" } }); var actionResult = _controller.GetNodes(); actionResult.Should().BeOfType <OkObjectResult>() .Which.Value.Should().BeAssignableTo <IEnumerable <Node> >() .Which.Should().BeEquivalentTo(new[] { new { IpOrHostname = "1.1.1.1" }, new { IpOrHostname = "2.2.2.2" } }, options => options.ExcludingMissingMembers().WithStrictOrdering()); }