Example #1
0
 public CustomerViewModel(Customer customer, ICustomerService service)
 {
     this.service = service;
     isNewCustomer = false;
     this.customer = customer;
     saveCommand = new RelayCommand(p => Save(), p => CanSave());
 }
Example #2
0
 public CustomerViewModel(ICustomerService service)
 {
     this.service = service;
     isNewCustomer = true;
     customer = new Customer
     {
         FirstName = String.Empty,
         LastName = String.Empty,
         Email = String.Empty
     };
     saveCommand = new RelayCommand(p => Save(), p => CanSave());
 }
Example #3
0
 public void TestType_DefaultToPersonal()
 {
     var customer = new Customer();
     Assert.AreEqual(CustomerType.Person, customer.Type);
 }
Example #4
0
 public void TestTotalSales_DefaultToZero()
 {
     var customer = new Customer();
     Assert.AreEqual(0, customer.TotalSales);
 }
Example #5
0
 public void TestLastName_DefaultToEmpty()
 {
     var customer = new Customer();
     Assert.AreEqual(String.Empty, customer.LastName);
 }
Example #6
0
 public void TestEmail_DefaultToEmpty()
 {
     var customer = new Customer();
     Assert.IsNotNull(customer.Email);
 }
Example #7
0
 public CustomerViewModel(Customer customer)
     : this(customer, new InMemoryCustomerService())
 {
 }
 public void SaveCustmer(Customer customer)
 {
     Customers.Add(customer);
 }