1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
6
using WixBinding.Tests.Utils;
8
namespace WixBinding.Tests.Utils.Tests
11
public class MockWorkbenchTests
13
MockWorkbench workbench;
18
workbench = new MockWorkbench();
22
public void ViewPassedToShowViewMethodIsAddedToViewContentsCollection()
24
MockViewContent view = new MockViewContent();
25
workbench.ShowView(view);
26
Assert.IsTrue(workbench.ViewContentCollection.Contains(view));
30
public void ActiveContentIsSaved()
32
MockViewContent view = new MockViewContent();
33
workbench.ActiveContent = view;
34
Assert.AreSame(view, workbench.ActiveContent);
38
public void ActiveViewContentIsSaved()
40
MockViewContent view = new MockViewContent();
41
workbench.ActiveViewContent = view;
42
Assert.AreSame(view, workbench.ActiveViewContent);
46
public void RaiseActiveViewContentChangedMethodFiresActiveViewContentChangedEvent()
48
bool eventFired = false;
49
workbench.ActiveViewContentChanged += delegate (object source, EventArgs e)
50
{ eventFired = true; };
52
workbench.RaiseActiveViewContentChangedEvent();
54
Assert.IsTrue(eventFired);
58
public void RaiseActiveViewContentChangedMethodDoesNotThrowNullReferenceExceptionWhenNoEventHandlersConfigured()
60
Assert.DoesNotThrow(delegate { workbench.RaiseActiveViewContentChangedEvent(); });