コード例 #1
0
        public async Task successful_response_with_idle_status()
        {
            var responseXml = new XmlDocument();

            responseXml.LoadXml(FULL_RESPONSE_BODY);
            var client = A.Fake <IEsclClient>();

            A.CallTo(() => client.GetAsync("http://192.168.0.151/eSCL/ScannerStatus"))
            .Returns(Task.FromResult <IEsclResponse>(new EsclResponse(content: responseXml)));

            var statusProvider = new StatusProvider(client, "192.168.0.151");
            var status         = await statusProvider.GetStatus();

            Assert.Equal("Idle", status.State);
            Assert.Equal("2.63", status.Version);
        }
コード例 #2
0
 public async Task <EsclStatus> GetStatus()
 {
     return(await statusProvider.GetStatus());
 }