Ejemplo n.º 1
0
        public void DoesAllStatsGetProcessed()
        {
            DataProviderSettings settings = new DataProviderSettings();

            settings.Location = "C:\\Dev\\DevApps\\StatSnapShotter\\StatSnapShotter\\StatConfiguration.xml";
            XMLConnection xmlConnection = new XMLConnection(settings);

            DataProviderSettings textfileSettings = new DataProviderSettings();

            textfileSettings.Location = "C:\\Dev\\DevApps\\StatSnapShotter\\StatSnapShotter\\storage.txt";
            textFileConnection        = new TextFileConnection(textfileSettings);

            DataProviderSettings seqSettings = new DataProviderSettings();

            seqSettings.Location = "http://localhost:5341/";
            seqSettings.APIKey   = "MbZ6wyBSuTVaYNfErgkO";
            seqConnection        = new SeqDataConnection(seqSettings);

            statConfiguration = new StatConfiguration(xmlConnection, "5");

            StatProcessor statProcessor = new StatProcessor(statConfiguration, seqConnection, textFileConnection);
            var           actual        = statProcessor.Run();
            var           expected      = 1;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void Read_Source_Seq_If_All_Settings_Is_Fine()
        {
            DataProviderSettings settings = new DataProviderSettings();

            settings.Location = "http://localhost:5341/";
            settings.APIKey   = "MbZ6wyBSuTVaYNfErgkO";
            seqConnection     = new SeqDataConnection(settings);

            var         expected = true;
            QueryParams parts    = new QueryParams()
            {
                query     = "SELECT * FROM STREAM",
                startDate = new DateTime(2018, 10, 15, 10, 0, 0),
                endDate   = new DateTime(2018, 10, 15, 14, 0, 0)
            };
            var actual = (QueryResultPart)seqConnection.Read(parts);

            Assert.AreEqual(expected, actual.Rows.Length >= 2);
        }
Ejemplo n.º 3
0
        public void Should_Fail_Nicely_When_Using_Invalid_SEQ_Server()
        {
            DataProviderSettings settings = new DataProviderSettings();

            settings.Location = "http://imchelle/";
            settings.APIKey   = "MbZ6wyBSuTVaYNfErgkO";

            seqConnection = new SeqDataConnection(settings);

            QueryParams parts = new QueryParams()
            {
                query     = "SELECT * FROM STREAM",
                startDate = new DateTime(2018, 9, 13, 16, 0, 0),
                endDate   = new DateTime(2018, 9, 14, 17, 0, 0)
            };

            QueryResultPart expected = null;
            var             actual   = (QueryResultPart)seqConnection.Read(parts);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void Should_Fail_Nicely_When_Using_Invalid_SEQ_API_Key()
        {
            DataProviderSettings settings = new DataProviderSettings();

            settings.Location = "http://localhost:5341/";
            settings.APIKey   = "InvalidPAIKey";

            seqConnection = new SeqDataConnection(settings);

            QueryParams parts = new QueryParams()
            {
                query     = "SELECT * FROM STREAM",
                startDate = new DateTime(2018, 10, 15, 10, 0, 0),
                endDate   = new DateTime(2018, 10, 15, 14, 0, 0)
            };

            var expected = true;
            var result   = (QueryResultPart)seqConnection.Read(parts);
            var actual   = result.Rows.Length > 0;

            Assert.AreEqual(expected, actual);
        }