Index: Core/Gui/test/Core.Gui.Test/Forms/ViewHost/DocumentViewControllerTest.cs =================================================================== diff -u -rbb2beabdf5dd4c19c6d8f5f741f4bda9482a2af2 -r8dffa3a4f0bd9085676cc7d3adfbc36a70f8ce00 --- Core/Gui/test/Core.Gui.Test/Forms/ViewHost/DocumentViewControllerTest.cs (.../DocumentViewControllerTest.cs) (revision bb2beabdf5dd4c19c6d8f5f741f4bda9482a2af2) +++ Core/Gui/test/Core.Gui.Test/Forms/ViewHost/DocumentViewControllerTest.cs (.../DocumentViewControllerTest.cs) (revision 8dffa3a4f0bd9085676cc7d3adfbc36a70f8ce00) @@ -133,7 +133,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -196,7 +197,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -253,7 +255,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestViewDerivative; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestViewDerivative; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -292,7 +295,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -331,7 +335,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestViewDerivative; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestViewDerivative; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -416,7 +421,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -462,7 +468,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -515,7 +522,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestView; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -569,7 +577,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(new IView[0]); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { view = invocation.Arguments[0] as TestViewDerivative; }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { view = invocation.Arguments[0] as TestViewDerivative; }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); mocks.ReplayAll(); @@ -646,7 +655,8 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(viewList); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => viewList.Add(invocation.Arguments[0] as TestView)); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => viewList.Add(invocation.Arguments[0] as TestView)); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); viewHost.Expect(vh => vh.BringToFront(Arg.Matches(c => c == viewList.First()))); @@ -833,9 +843,13 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(documentViews); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }).Repeat.Twice(); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }) + .Repeat.Twice(); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments().Repeat.Twice(); - viewHost.Expect(vh => vh.Remove(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Remove(invocation.Arguments[0] as TestView); }).Repeat.Twice(); + viewHost.Expect(vh => vh.Remove(Arg.Is.NotNull)) + .WhenCalled(invocation => { documentViews.Remove(invocation.Arguments[0] as TestView); }) + .Repeat.Twice(); mocks.ReplayAll(); @@ -855,6 +869,7 @@ } // Assert + CollectionAssert.IsEmpty(documentViews); mocks.VerifyAll(); } @@ -917,7 +932,9 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(documentViews); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }).Repeat.Twice(); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }) + .Repeat.Twice(); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments().Repeat.Twice(); mocks.ReplayAll(); @@ -955,7 +972,9 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(documentViews); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }).Repeat.Twice(); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }) + .Repeat.Twice(); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments().Repeat.Twice(); viewHost.Expect(vh => vh.Remove(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Remove(invocation.Arguments[0] as TestView); }); @@ -996,9 +1015,13 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(documentViews); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }).Repeat.Twice(); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }) + .Repeat.Twice(); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments().Repeat.Twice(); - viewHost.Expect(vh => vh.Remove(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Remove(invocation.Arguments[0] as TestView); }).Repeat.Twice(); + viewHost.Expect(vh => vh.Remove(Arg.Is.NotNull)) + .WhenCalled(invocation => { documentViews.Remove(invocation.Arguments[0] as TestView); }) + .Repeat.Twice(); mocks.ReplayAll(); var viewInfos = new ViewInfo[] @@ -1053,9 +1076,11 @@ viewHost.Stub(vh => vh.ViewClosed += null).IgnoreArguments(); viewHost.Stub(vh => vh.ViewClosed -= null).IgnoreArguments(); viewHost.Stub(vh => vh.DocumentViews).Return(documentViews); - viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }); + viewHost.Expect(vm => vm.AddDocumentView(Arg.Is.NotNull)) + .WhenCalled(invocation => { documentViews.Add(invocation.Arguments[0] as TestView); }); viewHost.Expect(vh => vh.SetImage(null, null)).IgnoreArguments(); - viewHost.Expect(vh => vh.Remove(Arg.Is.NotNull)).WhenCalled(invocation => { documentViews.Remove(invocation.Arguments[0] as TestView); }); + viewHost.Expect(vh => vh.Remove(Arg.Is.NotNull)) + .WhenCalled(invocation => { documentViews.Remove(invocation.Arguments[0] as TestView); }); mocks.ReplayAll();