Testing Panel loading in unit test

Docking/MDI for WPF Forum

Posted 5 years ago by eric
Version: 14.2.0611
Avatar

Hi,

i am currently changing my program to use the Actipro docking framework.

I managed to change everything but now some of my adapted unit tests are failing.

 

I have a code like the following to create the docksite used in the test and to load the saved layout:

 

Dim dmMain As New DockSite()

dmMain.Name = DockingSiteTools.DockSiteNameMain

DockingSiteTools.Instance.InitializePanelsProvider(dmMain)

 

In our code the InitializePanelsProvider basicly loads the docksite with the saved layout of a config.

 

During the test, after layout initilization, the dmMain.ToolWindows contains no toolwindow even if the loaded layout contains some.

Please note that the docksite is only created during the unit test and is therefore never really loaded inside a real window. Im wondering if this is the case of the issue.

Maybe some internal code is blocking the loading of the layout because it is not yet "loaded"?

 

If i perform the steps coded in the unit test in the real application, everything behaves properly.

 

Thanks,

 

Eric

Comments (2)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Eric,

Any tool windows that are specified in the tool window layout XML, need to already be assocated with the DockSite at the time the layout is deserialized.  By default, they will not be auto-created when encounted in the layout XML.  That's probably what you are seeing.

Please read through the "Layout Serialization" topic since it talks about some other options that might be helpful for your scenario, one of which can auto-create a stub tool window when an unknown one is encountered in the layout XML.


Actipro Software Support

Posted 5 years ago by eric
Avatar

Hi,

 

thanks for pointing this out. Indeed this is what was happening. It is working now.

 

Eric

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.