Пример #1
0
        public void WindowSnap_OnWindowStateNormalWindowBorderThicknessChange_NewThicknessEqualsZero()
        {
            // Arrange
            ITerminalContext context = new TestTerminalContext();

            context.UserAccount = new UserPublic()
            {
                ID = 1, FirstName = "Adam", LastName = "A", OAuthID = "12345"
            };
            MainWindowViewModel viewModel = new MainWindowViewModel(context);
            var thread = new Thread(() =>
            {
                WindowModel windowModel = new WindowModel()
                {
                    OpenedWindow = new Window()
                };

                context.WindowManager.OpenedViews.Add(nameof(MainWindowViewModel), windowModel);

                // ACT
                viewModel.WindowSnap();

                // ASSERT
                viewModel.GetWindowHandler().OpenedWindow.BorderThickness.Should().BeEquivalentTo(new Thickness(0));
            });

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            thread.Join();
        }
Пример #2
0
        public void WindowSnap_OnWindowStateNormalRestoreButtonContentChange_NewContentEqualsRestore()
        {
            // Arrange
            ITerminalContext context = new TestTerminalContext();

            context.UserAccount = new UserPublic()
            {
                ID = 1, FirstName = "Adam", LastName = "A", OAuthID = "12345"
            };
            MainWindowViewModel viewModel = new MainWindowViewModel(context);
            var thread = new Thread(() =>
            {
                WindowModel windowModel = new WindowModel()
                {
                    OpenedWindow = new Window()
                };

                context.WindowManager.OpenedViews.Add(nameof(MainWindowViewModel), windowModel);

                // ACT
                viewModel.WindowSnap();

                // ASSERT
                viewModel.RestoreButtonContent.Should().Be("\xE739");
            });

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            thread.Join();
        }
Пример #3
0
        public async Task AuthenticateWithMicrosoftAsync()
        {
            // Arrange
            ITerminalContext     context   = new TestTerminalContext();
            LoginWindowViewModel viewModel = new LoginWindowViewModel(context);

            // Act

            // Assert
        }