public void WhenGetMainScreen_ThenContextShouldBeLoginViewModel() { this.dataBaseService.Setup(x => x.GetUsers()).Returns(new List <string>()); var contextSwitcher = new ContextSwitcher(this.dataBaseService.Object); contextSwitcher.GetMainScreen(); this.dataBaseService.Verify(x => x.GetUsers(), Times.Once, "Users was not fetched from Database"); Approvals.Verify("Content = " + contextSwitcher.ViewModel.Context); }
public MainWindow() { InitializeComponent(); var dataBaseService = new DataBaseService(); var contextSwitcher = new ContextSwitcher(dataBaseService); contextSwitcher.CloseEvent += OnClose; this.DataContext = contextSwitcher.GetMainScreen(); }