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()); }
public void TestType_DefaultToPersonal() { var customer = new Customer(); Assert.AreEqual(CustomerType.Person, customer.Type); }
public void TestTotalSales_DefaultToZero() { var customer = new Customer(); Assert.AreEqual(0, customer.TotalSales); }
public void TestLastName_DefaultToEmpty() { var customer = new Customer(); Assert.AreEqual(String.Empty, customer.LastName); }
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); }