public void CloseAllWorkspacesTest()
 {
     WorkspaceManager target = new WorkspaceManager();
     MockWorkSpace mws1 = new MockWorkSpace(1);
     MockWorkSpace mws2 = new MockWorkSpace(2);
     MockWorkSpace mws3 = new MockWorkSpace(3);
     target.Workspaces.Add(mws1);
     target.Workspaces.Add(mws2);
     target.Workspaces.Add(mws3);
     target.CloseAllWorkspaces();
     Assert.AreEqual(0, target.Workspaces.Count);
     Assert.IsTrue(mws1.Disposed);
     Assert.IsTrue(mws2.Disposed);
     Assert.IsTrue(mws3.Disposed);
 }
 public void ShowTest3()
 {
     WorkspaceManager target = new WorkspaceManager();
     MockWorkSpace mws1 = new MockWorkSpace(1);
     MockWorkSpace mws2 = new MockWorkSpace(2);
     target.Workspaces.Add(mws1);
     target.Show(mws2);
     Assert.AreEqual(2, target.Workspaces.Count);
     Assert.AreEqual(mws2, target.GetCurrentWorkspace());
 }
 public void WorkspaceManagerConstructorTest()
 {
     WorkspaceManager target = new WorkspaceManager();
     Assert.AreEqual(0, target.Workspaces.Count);
 }
 public void ShowTest2()
 {
     WorkspaceManager target = new WorkspaceManager();
     MockWorkSpace mws1 = new MockWorkSpace(1);
     MockWorkSpace mws2 = new MockWorkSpace(2);
     target.Show(() => { return mws1; }, typeof(MockWorkSpace));
     target.Show(() => { return mws2; }, typeof(MockWorkSpace));
     Assert.AreEqual(1, target.Workspaces.Count);
 }
 public void ShowTest1()
 {
     WorkspaceManager target = new WorkspaceManager();
     target.Show(() => { return new MockWorkSpace(42); }, typeof(MockWorkSpace));
     Assert.AreEqual(1, target.Workspaces.Count);
 }
 public void GetCurrentWorkspaceTest()
 {
     WorkspaceManager target = new WorkspaceManager();
     MockWorkSpace mws1 = new MockWorkSpace(1);
     MockWorkSpace mws2 = new MockWorkSpace(2);
     MockWorkSpace mws3 = new MockWorkSpace(3);
     target.Workspaces.Add(mws1);
     target.Workspaces.Add(mws2);
     target.Workspaces.Add(mws3);
     target.SetActiveWorkspace(mws2);
     var actual = target.GetCurrentWorkspace();
     Assert.AreEqual(mws2, actual);
 }
 public void CloseWorkspaceTest2()
 {
     WorkspaceManager target = new WorkspaceManager();
     target.CloseWorkspace();
 }
 public void CloseWorkspaceTest1()
 {
     WorkspaceManager target = new WorkspaceManager();
     MockWorkSpace mws1 = new MockWorkSpace(1);
     MockWorkSpace mws2 = new MockWorkSpace(2);
     MockWorkSpace mws3 = new MockWorkSpace(3);
     target.Workspaces.Add(mws1);
     target.Workspaces.Add(mws2);
     target.Workspaces.Add(mws3);
     target.SetActiveWorkspace(mws2);
     target.CloseWorkspace();
     Assert.AreEqual(2, target.Workspaces.Count);
     Assert.IsFalse(mws1.Disposed);
     Assert.IsTrue(mws2.Disposed);
     Assert.IsFalse(mws3.Disposed);
 }