Example #1
0
 public B40040(string FilePath, string emDate, string oswGrpLookItemVal)
 {
     _lsFile     = FilePath;
     _oswGrpVal  = oswGrpLookItemVal;
     _emDateText = emDate;
     dao40040    = new D40040();
 }
        public void ListMg8DataTest()
        {
            DataTable dt = new D40040().ListMg8Data(new DateTime(2018, 10, 12), "1%");

            //2018/10/12的資料有8筆
            Assert.AreEqual(8, dt.Rows.Count);
        }
        public void ListEtfMg6DataTest()
        {
            DataTable dt = new D40040().ListEtfMg6Data(new DateTime(2018, 10, 12));

            //2018/10/12的資料有16筆
            Assert.AreEqual(16, dt.Rows.Count);
        }
        public void GetDateLastSheet2Test()
        {
            DateTime dateTime = new D40040().GetDateLast(new DateTime(2018, 10, 12), 1);

            //2018/10/12的前一交易日為2018/10/11
            Assert.AreEqual(new DateTime(2018, 10, 11), dateTime);
        }
        public void GetDateLastSheet1Test()
        {
            DateTime dateTime = new D40040().GetDateLast(new DateTime(2018, 10, 12), 1);

            //2018/10/12的前一交易日為2018/10/11
            Assert.AreEqual("2018/10/11", dateTime.ToString("yyyy/MM/dd"));
        }
        public void GetListTest()
        {
            DataTable dt = new D40040().ListData(new DateTime(2018, 10, 12), "1%");

            //2018/10/12的資料有15筆
            Assert.AreEqual(15, dt.Rows.Count);
        }
        public void ListEtfDataTest()
        {
            DateTime  dateTime = new D40040().GetDateLast(new DateTime(2018, 10, 12), 1);
            DataTable dt       = new D40040().ListEtfData(new DateTime(2018, 10, 12), dateTime, "1%");

            //2018/10/12的資料有4筆
            Assert.AreEqual(4, dt.Rows.Count);
        }
        public void ListMg6DataTest()
        {
            DateTime  dateTime = new D40040().GetDateLast(new DateTime(2018, 10, 12), 0);
            DataTable dt       = new D40040().ListMg6Data(new DateTime(2018, 10, 12), dateTime, "%");

            //2018/10/12的資料有20筆
            Assert.AreEqual(20, dt.Rows.Count);
        }
        public void ListSpanSvDataTest()
        {
            //Excel讀取Value
            string   ExcelCellVal = "2014/12/1";
            DateTime dateTime     = DateTime.MinValue;

            DateTime.TryParse(ExcelCellVal, out dateTime);
            DataTable dt = new D40040().ListSpanSvData(new DateTime(2018, 10, 12), dateTime, "1%");

            //2018/10/12的資料有10筆
            Assert.AreEqual(10, dt.Rows.Count);
        }
        public void List40040SPTest()
        {
            DataTable dt = new D40040().List40040SP(new DateTime(2018, 10, 12), "%");

            Assert.IsNotNull(dt);
        }