コード例 #1
0
ファイル: Program.cs プロジェクト: mikand13/school_portfolio
        private static void Main()
        {
            Bakery.GetInstance();

            var c = new CustomerFactory();
            c.CreateCustomer("Fred");
            c.CreateCustomer("Greg");
            c.CreateCustomer("Ted");
        }
コード例 #2
0
        public void CreateCustomerTest() {
            ProcessThreadCollection currentThreads = Process.GetCurrentProcess().Threads;

            var beforeStartingThreads = currentThreads.Count;

            CustomerFactory customerFactory = new CustomerFactory();
            customerFactory.CreateCustomer("Fred");
            customerFactory.CreateCustomer("Greg");
            customerFactory.CreateCustomer("Ted");

            var afterStartingThreads = currentThreads.Count;

            Assert.AreEqual(beforeStartingThreads, afterStartingThreads);
        }