Ejemplo n.º 1
0
        public async Task <IReadOnlyDictionary <string, Toptout> > ListTelemetryAsync()
        {
            Dictionary <string, Toptout> telemetry = null;
            var teleApi = new TelemetryApi();

            try {
                List <Toptout> ts = await teleApi.GetTelemetryAsync();

                telemetry = new Dictionary <string, Toptout>(
                    ts.Select(t => new KeyValuePair <string, Toptout>(t.Id, t)));
            }
            catch {
                return(null);
            }

            return(telemetry);
        }
        public void Call_To_TelemetryApi()
        {
            var teleApi = new TelemetryApi();

            var apps = Call_To_AppApi();

            Toptout t = null;

            try {
                t = teleApi.GetTelemetryById(apps[2]);
            }
            catch {
                Assert.True(false, "Exception during GetTelemetryById");
            }

            Assert.NotNull(t);
        }