Beispiel #1
0
        public void share_test()
        {
            var      ts = GetTrader();
            SysShare ss = new SysShare(ts);

            ss.Execute();

            SystemAccount.Instance.Borrow(1000, new Order {
                Trader = ts[0]
            });

            for (int i = 1; i < 10; i++)
            {
                ts[i].Account.BailAccount.Add(i * 10000);
            }
            ss.SetIsFirst(false);
            ss.Execute();
            for (int i = 1; i < 10; i++)
            {
                Assert.IsTrue(ts[i].Account.BailAccount.Total < 1000000 + i * 10000);
            }
            Assert.AreEqual(0, SystemAccount.Instance.PublicSum);

            for (int i = 0; i < 10; i++)
            {
                Assert.AreEqual(ts[i].Account.BailAccount.Total, ts[i].GetPreBailTotalSnap());
            }
            Assert.AreEqual(SystemAccount.Instance.PublicSum, SystemAccount.Instance.GetPreTotal());
        }
Beispiel #2
0
        public void snap_test()
        {
            var      ts = GetTrader();
            SysShare ss = new SysShare(ts);

            ss.Execute();
            foreach (var v in ts)
            {
                Assert.AreEqual(v.Account.BailAccount.Total, v.GetPreBailTotalSnap());
            }
        }