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