示例#1
0
        private static void Main()
        {
            Bakery.GetInstance();

            var c = new CustomerFactory();
            c.CreateCustomer("Fred");
            c.CreateCustomer("Greg");
            c.CreateCustomer("Ted");
        }
        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);
        }