Пример #1
0
        //create
        public void AddCustomerToDir_ShouldGetCorrectBoolean()
        {
            //Arrange
            Customer     customer = new Customer();
            CustomerRepo repo     = new CustomerRepo();
            //Act
            bool addResult = repo.AddCustomerToDir(customer);

            //Assert
            Assert.IsTrue(addResult);
        }
Пример #2
0
        private void CreateCustomer()
        {
            Console.Clear();
            Customer newCustomer = new Customer();

            Console.WriteLine("Welcome to the Create Customer Page\n");
            Console.WriteLine("Please enter a first name:");
            newCustomer.FirstName = Console.ReadLine();
            Console.WriteLine("Please enter a last name:");
            newCustomer.LastName = Console.ReadLine();
            Console.WriteLine("Please select a customer type by number\n" +
                              "1: Potential\n" +
                              "2: Current\n" +
                              "3: Past");
            string customerTypes = Console.ReadLine();

            switch (customerTypes)
            {
            case "1":
                newCustomer.CustomerTypecast = CustomerType.Potential;
                break;

            case "2":
                newCustomer.CustomerTypecast = CustomerType.Current;
                break;

            case "3":
                newCustomer.CustomerTypecast = CustomerType.Past;
                break;

            default:
                Console.WriteLine("Please enter a valid value");
                break;
            }
            _customerRepo.AddCustomerToDir(newCustomer);
        }
Пример #3
0
        //read
        public void GetCustomers()
        {
            //Arrange
            //Add content
            Customer customer = new Customer();
            //create repo
            CustomerRepo repo = new CustomerRepo();

            //add content to repo(customer)
            repo.AddCustomerToDir(customer);
            //act
            //store list of customers w/n variable
            List <Customer> customers = repo.GetCustomer();
            //looks thourgh list and returns true if customers exist
            bool directoryHasCustomers = customers.Contains(customer);

            //assert
            Assert.IsTrue(directoryHasCustomers);
        }
Пример #4
0
 public void Arrange()
 {
     _repo     = new CustomerRepo();
     _customer = new Customer("Kanye", "West", CustomerType.Current);
     _repo.AddCustomerToDir(_customer);
 }