public void GetValues_SaveXmlFilesFlag_ReturnsSameData(string url, string siteCode, string varCode,
                                                               string startDate, string endDate)
        {
            const string DATES_FORMAT = "MM/dd/yyyy";
            var          provider     = CultureInfo.InvariantCulture;

            var target = new WaterOneFlowClient(url, 5);
            var start  = DateTime.ParseExact(startDate, DATES_FORMAT, provider);
            var end    = DateTime.ParseExact(endDate, DATES_FORMAT, provider);

            try
            {
                target.SaveXmlFiles = false;
                var series1 = target.GetValues(siteCode, varCode, start, end);

                target.SaveXmlFiles = true;
                var series2 = target.GetValues(siteCode, varCode, start, end);

                Assert.AreEqual(series1.Count, series2.Count);
                for (var i = 0; i < series1.Count; i++)
                {
                    var site1 = series1[i].Site;
                    var site2 = series2[i].Site;
                    var var1  = series1[i].Variable;
                    var var2  = series2[i].Variable;

                    Assert.AreEqual(site1.Code, site2.Code);
                    Assert.AreEqual(site1.Name, site2.Name);
                    Assert.AreEqual(series1[i].ValueCount, series2[i].ValueCount);
                    Assert.AreEqual(var1.Code, var2.Code);
                    Assert.AreEqual(var1.Name, var2.Name);
                }
            }
            catch (WebException ex)
            {
                if (ex.Status.HasFlag(WebExceptionStatus.ProtocolError) ||
                    ex.Status.HasFlag(WebExceptionStatus.Timeout))
                {
                    Assert.Inconclusive("Unable to test GetValues() from: " + url);
                }
                throw;
            }
        }
        public void TestLittleBearRiver_10()
        {
            string                 url            = @"http://icewater.usu.edu/LittleBearRiver/cuahsi_1_0.asmx";
            WaterOneFlowClient     client         = new WaterOneFlowClient(url);
            IList <Site>           sites          = client.GetSites();
            IList <SeriesMetadata> seriesList     = client.GetSiteInfo(sites[0].Code);
            IList <Series>         downloadedData = client.GetValues(seriesList[0].Site.Code, seriesList[0].Variable.Code, DateTime.MinValue, DateTime.Now);

            Assert.IsNotNull(seriesList);
            Assert.Greater(seriesList.Count, 0);
            Assert.AreNotEqual(seriesList[0].Source.ToString(), "unknown");
            Assert.AreNotEqual(seriesList[0].Method.ToString(), "unknown");
        }
        public void TestCIMSservice()
        {
            string             url          = @"http://cbe.cae.drexel.edu/CIMS/cuahsi_1_1.asmx";
            string             siteCode     = "CIMS:EE3.4";
            string             variableCode = "CIMS:NO3F";
            WaterOneFlowClient client       = new WaterOneFlowClient(url);
            IList <Series>     series       = client.GetValues(siteCode, variableCode, DateTime.Now.AddYears(-30), DateTime.Now);

            Assert.IsNotNull(series);
            Assert.Greater(series.Count, 0);
            Assert.AreNotEqual(series[0].Source.ToString(), "unknown");
            Assert.AreNotEqual(series[0].Method.ToString(), "unknown");
        }
        public void TestSeriesWithSamples()
        {
            string             url          = @"http://water.sdsc.edu/lbrsdsc/cuahsi_1_1.asmx";
            WaterOneFlowClient client       = new WaterOneFlowClient(url);
            string             siteCode     = "LBR11:USU-LBR-Paradise";
            string             variableCode = "LBR11:USU39";
            IList <Series>     series       = client.GetValues(siteCode, variableCode, DateTime.MinValue, DateTime.Now);

            Assert.IsNotNull(series);
            Assert.Greater(series.Count, 0);
            Assert.AreNotEqual(series[0].Source.ToString(), "unknown");
            Assert.AreNotEqual(series[0].Method.ToString(), "unknown");
        }
        public void TestNWISDV_10()
        {
            string   url          = @"http://river.sdsc.edu/wateroneflow/NWIS/Data.asmx";
            string   siteCode     = "NWISDV:13069500";
            string   variableCode = "NWISDV:00060/DataType=Average";
            DateTime start        = new DateTime(2010, 1, 1);
            DateTime end          = new DateTime(2011, 1, 1);

            WaterOneFlowClient client     = new WaterOneFlowClient(url);
            IList <Series>     seriesList = client.GetValues(siteCode, variableCode, start, end);

            Assert.Greater(seriesList.Count, 0);
            Assert.Greater(seriesList[0].DataValueList.Count, 0);
        }
        public void TestBaltimoreGW_10()
        {
            string             url          = @"http://his09.umbc.edu/BaltGW/cuahsi_1_0.asmx";
            string             siteCode     = "BaltimoreGW:WOLDEAMANUEL";
            string             variableCode = "BaltimoreGW:WATERASL";
            DateTime           beginDate    = new DateTime(2000, 1, 1);
            DateTime           endDate      = DateTime.Now;
            WaterOneFlowClient client       = new WaterOneFlowClient(url);
            IList <Series>     series       = client.GetValues(siteCode, variableCode, beginDate, endDate);

            Assert.IsNotNull(series);
            Assert.Greater(series.Count, 0);
            Assert.AreNotEqual(series[0].Source.ToString(), "unknown");
            Assert.AreNotEqual(series[0].Method.ToString(), "unknown");
        }