コード例 #1
0
 public void writeSingleUserTest()
 {
     Users test = new Users();
     test.addUser("third");
     test.addStcokForUser("third","AAPL",400);
     test.addStcokForUser("third", "FB", 700);
     //test.writeSingleUserData("ttt.txt", "third");
 }
コード例 #2
0
        public ServerMainThread()
        {
            Stocklist = new Stock();
            userList = new Users();

            thread = new Thread(new ThreadStart(serverthread));
            watchdog = new Thread(new ThreadStart(stockwatchdog));
            //serviceClient = new ClientServiceThread();

            stop = false;
        }
コード例 #3
0
        public void getUserTest()
        {
            Users test = new Users();
            test.getUserDataFromFile("ttt.txt");
            foreach(string key in test.UserDictionary.Keys){
                Console.WriteLine("{0} {1}", key, test.UserDictionary[key].cashBalance);
                foreach (string key2 in test.UserDictionary[key].StockShares.Keys)
                {
                    Console.WriteLine("{0} {1}", key2, test.UserDictionary[key].StockShares[key2]);
                }

            }
        }
コード例 #4
0
        public void AddTestMethod()
        {
            Users test = new Users();
            test.addUser("hello");
            Console.WriteLine("User:hello's balance: {0}", test.UserDictionary["hello"].cashBalance);
            test.modifyCash("hello", 100, true);
            Console.WriteLine("User:hello's balance: {0}", test.UserDictionary["hello"].cashBalance);

            if (test.UserDictionary.ContainsKey("hello"))
            {
                if (test.addStcokForUser("hello", "AAPL", 100))
                {
                    Console.WriteLine("123");
                    Console.WriteLine("User:hello's STOCK: {0}", test.UserDictionary["hello"].StockShares["AAPL"]);
                }

            }
        }
コード例 #5
0
        public void UsersMethod()
        {
            Users test = new Users();
            test.addUser("hello");
            Console.WriteLine("User:hello's balance: {0}", test.UserDictionary["hello"].cashBalance);
            test.modifyCash("hello", 100, true);
            Console.WriteLine("User:hello's balance: {0}", test.UserDictionary["hello"].cashBalance);

            if (test.UserDictionary.ContainsKey("hello"))
            {
                if (test.addStcokForUser("hello", "AAPL", 100))
                {
                    Console.WriteLine("123");
                    Console.WriteLine("User:hello's STOCK: {0}", test.UserDictionary["hello"].StockShares["AAPL"]);
                }

            }

            test.addStcokForUser("hello", "FB", 500);

            test.addUser("second");
            test.addStcokForUser("second", "AAPL", 400);
            test.writeAllUserData("ttt.txt");
        }
コード例 #6
0
ファイル: Main.cs プロジェクト: DQST/Chat
 private void toolStripMenuItem2_Click(object sender, EventArgs e)
 {
     Users users = new Users();
     users.Show(this);
 }