Index: Core/Gui/test/Core.Gui.Test/Forms/ViewHost/AvalonDockViewHostTest.cs =================================================================== diff -u -rbbb6068d01161dfc28efeb537d9c4ff324c373b8 -r4a4926fd3db51b8192d04604ea4f4a65d28765f7 --- Core/Gui/test/Core.Gui.Test/Forms/ViewHost/AvalonDockViewHostTest.cs (.../AvalonDockViewHostTest.cs) (revision bbb6068d01161dfc28efeb537d9c4ff324c373b8) +++ Core/Gui/test/Core.Gui.Test/Forms/ViewHost/AvalonDockViewHostTest.cs (.../AvalonDockViewHostTest.cs) (revision 4a4926fd3db51b8192d04604ea4f4a65d28765f7) @@ -171,6 +171,24 @@ } [Test] + public void AddDocumentView_WithTitle_ViewAddedWithExpectedTitle() + { + // Setup + using (var avalonDockViewHost = new AvalonDockViewHost()) + { + const string title = "Random title"; + + var testView = new TestView(); + + // Call + avalonDockViewHost.AddDocumentView(testView, title); + + // Assert + Assert.IsTrue(IsTitleSet(avalonDockViewHost, testView, title)); + } + } + + [Test] public void AddDocumentView_DocumentViewWasAlreadyAdded_NoDuplicationNoViewOpenedEventFired() { // Setup @@ -545,6 +563,24 @@ } [Test] + public void AddToolView_WithTitle_ViewAddedWithExpectedTitle() + { + // Setup + using (var avalonDockViewHost = new AvalonDockViewHost()) + { + const string title = "Random title"; + + var testView = new TestView(); + + // Call + avalonDockViewHost.AddToolView(testView, ToolViewLocation.Left, title, string.Empty); + + // Assert + Assert.IsTrue(IsTitleSet(avalonDockViewHost, testView, title)); + } + } + + [Test] public void AddToolView_InvalidPosition_ThrowsInvalidEnumArgumentException() { // Setup @@ -870,6 +906,15 @@ .OfType() .First(lc => ((WindowsFormsHost) lc.Content).Child == view).IconSource != null; } + + private static bool IsTitleSet(AvalonDockViewHost avalonDockViewHost, IView view, string title) + { + return avalonDockViewHost.DockingManager + .Layout + .Descendents() + .OfType() + .First(lc => ((WindowsFormsHost) lc.Content).Child == view).Title == title; + } private static void SetActiveView(AvalonDockViewHost avalonDockViewHost, IView view) {