public void Skills_AllEnumValuesReturned() { var customerServiceMock = GetMockedCustomerService(); var viewModel = new EmployeeReservationViewModel(customerServiceMock.Object, new EmployeeReservationServiceMock()); Assert.AreEqual(7, viewModel.Skills.Count); Assert.IsTrue(viewModel.Skills.Contains(Skill.WCF)); }
public EmployeeReservation() { this.InitializeComponent(); if (!DesignerProperties.GetIsInDesignMode(this)) { this.viewModel = new EmployeeReservationViewModel(); this.viewModel.Init(); this.DataContext = this.viewModel; } }
public void Init_FirstCustomerSelected_SelectedCustomerValueWasSet() { // Arrange var mock = GetMockedService(); var customerServiceMock = GetMockedCustomerService(); var viewModel = new EmployeeReservationViewModel(customerServiceMock.Object, mock.Object); // Act viewModel.Init(); // Assert Assert.AreEqual(1, viewModel.SelectedCustomer.Id); }
public void Init_FillsAvailableCustomers() { // Arrange var customerServiceMock = GetMockedCustomerService(); var mock = GetMockedService(); var viewModel = new EmployeeReservationViewModel(customerServiceMock.Object, mock.Object); // Act viewModel.Init(); // Assert Assert.IsTrue(viewModel.Customers.Any(c => c.Id == 1)); }