Esempio n. 1
0
        public void Add_Multi()
        {
            var db = new OptionDbCtx();
            var v  = new ContractRepo(db);

            for (int i = 0; i < 10; i++)
            {
                var r = v.Add("btc", DateTime.Now.AddMonths(i + 1), 100, OptionType.认购期权, "比特币");
            }

            for (int i = 0; i < 10; i++)
            {
                var r = v.Add("btc", DateTime.Now.AddMonths(i + 1), 100, OptionType.认沽期权, "比特币");
            }
            Assert.IsNotNull(v);
        }
Esempio n. 2
0
        public void Add_test()
        {
            var db = new OptionDbCtx();
            var v  = new ContractRepo(db);
            var r  = v.Add("btc", DateTime.Now.AddMonths(1), 100, OptionType.认购期权, "比特币");

            SingletonWithInit <ContractService> .Instance.Flush();

            Assert.AreEqual(true, r);
        }