コード例 #1
0
        public void TestDeleteFromModelSuccess()
        {
            var customer = new Customer("Adam", "Hansen", "Test");

            var customerId = customer.Id;

            _customerModel.AddCustomer(customer);

            _customerModel.DeleteCustomerById(customerId);

            Assert.IsFalse(_customerModel.GetCustomers().Any());
        }
コード例 #2
0
        /// <summary>
        /// Give user option to delete a customer
        /// </summary>
        private static void DisplayDeleteCustomer()
        {
            ListAllCustomers();

            Console.WriteLine();

            if (CustomerModel.GetCustomers().Any())
            {
                Console.WriteLine("Please write id of customer to delete");

                var customerIdInput = MenuManager.GetSelectedCustomerId(CustomerModel.GetCustomers());

                CustomerModel.DeleteCustomerById(customerIdInput);

                Console.WriteLine("Customer Deleted!");
            }
        }