Exemple #1
0
        public void CanGetMultipleFrequenciesFromGetObservations()
        {
            var request = ClientHandler.GetObservations.CreateRequest(
                "dmx:.\\..\\..\\..\\..\\data\\sample.dmx",
                new[] { "BCA_GDP" },
                "MQA"
                );
            var response = ServerHandler.CallGetObservations(request);

            ClientHandler.GetObservations.ShowResponse(response);

            foreach (var s in response.Seriesdata)
            {
                Console.WriteLine($"{s.Key.Sourcename}/{s.Key.Seriesname}");

                Console.WriteLine("    M");
                foreach (var ok in s.Values.Keys.Where((k) => k.Contains("M")))
                {
                    Console.WriteLine($"    {ok}");
                }
                Console.WriteLine("    A");
                foreach (var ok in s.Values.Keys.Where((k) => k.Contains("A")))
                {
                    Console.WriteLine($"    {ok}");
                }
            }
            Assert.IsNotNull(response);
        }
Exemple #2
0
        public void StressTest()
        {
            var start = DateTime.Now;

            var gskRequest = ClientHandler.GetSeriesKeys.CreateRequest(
                new[] { "dmx:.\\..\\..\\..\\..\\data\\tcd.dmx" },
                new[] { "oname:%" }
                );
            var gskResponse = ServerHandler.CallGetSeriesKeys(gskRequest);

            ClientHandler.GetSeriesKeys.ShowResponse(gskResponse);
            Assert.IsNotNull(gskResponse);
            Assert.IsTrue(gskResponse.Keys.Count > 0);

            var goRequest = ClientHandler.GetObservations.CreateRequest(
                "dmx:.\\..\\..\\..\\..\\data\\tcd.dmx",
                gskResponse.Keys.Select(k => k.Seriesname),
                "MQA"
                );
            var goResponse = ServerHandler.CallGetObservations(goRequest);

            ClientHandler.GetObservations.ShowResponse(goResponse);

            var duration = DateTime.Now - start;

            Console.WriteLine($"StressTest done in {duration}");
        }
Exemple #3
0
        public void CanCallGetObservations()
        {
            var request = ClientHandler.GetObservations.CreateRequest(
                "dmx:.\\..\\..\\..\\..\\data\\sample.dmx",
                new[] { "911BE", "911BEA", "BCA_GDP" },
                "MA"
                );
            var response = ServerHandler.CallGetObservations(request);

            ClientHandler.GetObservations.ShowResponse(response);
            Assert.IsNotNull(response);
        }
Exemple #4
0
        public void CanHandleTimeseriesLevelErrors01()
        {
            var goRequest = ClientHandler.GetObservations.CreateRequest(
                "dmx:.\\..\\..\\..\\..\\data\\tcd.dmx",
                new[] { "628NGD%" },
                "MQA"
                );
            var goResponse = ServerHandler.CallGetObservations(goRequest);

            ClientHandler.GetObservations.ShowResponse(goResponse);
            Assert.IsNotNull(goResponse);
            Assert.IsTrue(goResponse.Seriesdata.Count > 0);
        }
Exemple #5
0
        public void CannotUseWildcardsInGetObservations()
        {
            var request = ClientHandler.GetObservations.CreateRequest(
                "dmx:.\\..\\..\\..\\..\\data\\sample.dmx",
                new[] { "911B%" },
                "MA"
                );
            var response = ServerHandler.CallGetObservations(request);

            ClientHandler.GetObservations.ShowResponse(response);
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Seriesdata.Count == 0);

            request = ClientHandler.GetObservations.CreateRequest(
                "dmx:.\\..\\..\\..\\..\\data\\sample.dmx",
                new[] { "911BE" },
                "MA"
                );
            response = ServerHandler.CallGetObservations(request);
            ClientHandler.GetObservations.ShowResponse(response);
            Assert.IsNotNull(response);
            Assert.IsTrue(response.Seriesdata.Count > 0);
        }