Example #1
0
        public void Desktop_MultipleWorkspaces()
        {
            Desktop desktop = new Desktop();

            bool exited = false;

            desktop.Empty += () => exited = true;

            var workspace1 = CreateWorkspace("default", CommonMocks.Widget("window").Object);
            var workspace2 = CreateWorkspace("other", CommonMocks.Widget("window").Object);

            desktop.PushWorkspace(workspace1);
            desktop.PushWorkspace(workspace2);

            desktop.ActiveWorkspace.Should().BeSameAs(workspace2);
            desktop.WaitForAnimations();
            desktop.ActiveWorkspace.Should().BeSameAs(workspace2);

            desktop.PopWorkspace();

            desktop.ActiveWorkspace.Should().BeSameAs(workspace2, "Active workspace should still be the old one, until the transition out animation is complete.");
            desktop.WaitForAnimations();
            desktop.ActiveWorkspace.Should().BeSameAs(workspace1, "Transition out animation is complete, so the active workspace should be the one underneath.");

            desktop.PopWorkspace();
            desktop.WaitForAnimations();

            exited.Should().BeTrue();
        }