Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();
            var dataBaseService = new DataBaseService();
            var contextSwitcher = new ContextSwitcher(dataBaseService);

            contextSwitcher.CloseEvent += OnClose;
            this.DataContext            = contextSwitcher.GetMainScreen();
        }