public void DatasetManager_GetScalarData_AuthenticationLog_Username_Field_FailedLogin()
        {
            //the getfilters function gets distinct values from a table field that will
            //used to build the query to get the dataset. Controler only pulling from fireincidents for now. need to make it dynamic.
            List <QueryFilter> filters = new List <QueryFilter>();
            QueryFilter        qf      = new QueryFilter();

            qf.Field    = "Authenticated";
            qf.Operator = "=";
            qf.Value    = "0";
            qf.Type     = "sql"; //tell the parser is a sql query
            qf.Junction = "AND"; //since more filters are to follow add a conjunction.
            filters.Add(qf);

            #region Date range query filter
            qf          = new QueryFilter();
            qf.Field    = "AuthenticationDate";
            qf.Operator = "BETWEEN";
            qf.Type     = "sql"; //tell the parser is a sql query
            qf.Value    = DateTime.UtcNow.AddMonths(-1).AddDays(-1).ToShortDateString();
            qf.Order    = 0;     //this is the first part of the between statement
            qf.Junction = "AND";
            filters.Add(qf);

            qf          = new QueryFilter();
            qf.Field    = "AuthenticationDate";
            qf.Operator = "BETWEEN";
            qf.Type     = "sql"; //tell the parser is a sql query
            qf.Value    = DateTime.UtcNow.AddMonths(-1).AddDays(1).ToShortDateString();
            qf.Order    = 1;     //second part of the between statement
            qf.Junction = "AND";
            filters.Add(qf);
            #endregion

            qf          = new QueryFilter();
            qf.Field    = "UserName";
            qf.Operator = "=";
            qf.Type     = "sql";//tell the parser is a sql query
            qf.Value    = "beta_fail_login";
            filters.Add(qf);

            DatasetManager dm = new DatasetManager(new TreeMonDbContext(connectionKey));
            DataPoint      dp = dm.GetScalarData("AuthenticationLog", "UserName", filters);//get usernames in AuthenticationLog

            Assert.AreEqual(dp.ValueType.ToUpper(), "STRING");
            Assert.AreEqual(dp.Value, "beta_fail_login");
        }
        public void DatasetManager_GetScalarData_AuthenticationLog_Username_Field()
        {
            //the getfilters function gets distinct values from a table field that will
            //used to build the query to get the dataset. Controler only pulling from fireincidents for now. need to make it dynamic.
            List <QueryFilter> filters = new List <QueryFilter>();
            QueryFilter        qf      = new QueryFilter();

            filters.Add(qf);


            //List<QueryFilter> filters = JsonConvert.DeserializeObject<List<QueryFilter>>(body);

            DatasetManager dm = new DatasetManager(new TreeMonDbContext(connectionKey));
            DataPoint      dp = dm.GetScalarData("AuthenticationLog", "UserName", null);//get usernames in AuthenticationLog

            Assert.AreEqual(dp.ValueType.ToUpper(), "STRING");
            Assert.AreEqual(dp.Value.ToUpper(), "ALPHA");
        }