Exemplo n.º 1
0
        public async Task GridStatusCall(string payload, GridStatus expected)
        {
            var mockHttp = new MockHttpMessageHandler();

            mockHttp
            .When("http://localhost/api/system_status/grid_status")
            .Respond("application/json", payload);

            var mockClient = mockHttp.ToHttpClient();

            mockClient.BaseAddress = new Uri("http://localhost");

            var gatewayClient = new GatewayClient(mockClient);
            var gridStatus    = await gatewayClient.GetGridStatus();

            Assert.AreEqual(expected.GridServicesActive, gridStatus.GridServicesActive);
            Assert.AreEqual(expected.GridStatusGridStatus, gridStatus.GridStatusGridStatus);
        }