Exemplo n.º 1
0
        public async Task GetAgentsTest()
        {
            using SimpleClicksSoapClient client = await new SimpleClicksSoapClient(
                      new Uri(ServiceUri), new NetworkCredential(Username, Password)).Configure();

            GetAgentsResponse getAgents = await client.Request <GetAgentsResponse>(new GetAgentsRequest());

            TestContext.WriteLine(JsonSerializer.Serialize(getAgents, new JsonSerializerOptions()
            {
                WriteIndented = true
            }));
            Assert.IsNotNull(getAgents);
        }
Exemplo n.º 2
0
        public async Task GetCountersTest()
        {
            using SimpleClicksSoapClient client = await new SimpleClicksSoapClient(
                      new Uri(ServiceUri), new NetworkCredential(Username, Password)).Configure();

            GetAgentsResponse getAgents = await client.Request <GetAgentsResponse>(new GetAgentsRequest());

            GetDevicesResponse getDevices = await client.Request <GetDevicesResponse>(new GetDevicesRequest(getAgents.Agents[0].AgentId));

            XDocument xml = await client.Request(new GetCountersRequest(getAgents.Agents[0].AgentId, getDevices.Devices[0].DeviceId));

            TestContext.WriteLine(xml);

            Assert.IsNotNull(getAgents);
        }