Exemplo n.º 1
0
        public void GetIndividualInfo()
        {
            Crud_Repository repoInfo      = new Crud_Repository();
            Crud            customerInfo  = new Crud(1, "John", "Walters", CustomerType.Current);
            Crud            customerInfo2 = new Crud(2, "Jan", "Fittz", CustomerType.Current);

            repoInfo.AddCustomerToEmailList(customerInfo);
            repoInfo.AddCustomerToEmailList(customerInfo2);

            var expected = customerInfo2;
            var actual   = repoInfo.GetCustomerInfo(2);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void AddAndGetMethod()
        {
            Crud_Repository repoInfo      = new Crud_Repository();
            Crud            customerInfo  = new Crud(1, "John", "Walters", CustomerType.Current);
            Crud            customerInfo2 = new Crud(2, "Jan", "Fittz", CustomerType.Current);

            repoInfo.AddCustomerToEmailList(customerInfo);
            repoInfo.AddCustomerToEmailList(customerInfo2);
            List <Crud> list = repoInfo.GetAllCustomerInfo();

            var expected = 2;
            var actual   = list.Count;

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        private void AddACustomer()
        {
            Console.WriteLine("What is the customers ID number?");
            int customerID = int.Parse(Console.ReadLine());

            Console.WriteLine("What is the customers first name?");
            string firstName = Console.ReadLine();

            Console.WriteLine("What is the customers last name?");
            string lastName = Console.ReadLine();

            Console.WriteLine("What number best describes the customer?\n" +
                              "1: Potential\n" +
                              "2: Current\n" +
                              "3: Past");
            int          customer     = int.Parse(Console.ReadLine());
            CustomerType customerType = (CustomerType)customer;

            Crud newCustomer = new Crud(customerID, firstName, lastName, customerType);

            _customerRepo.AddCustomerToEmailList(newCustomer);
        }