Thank you for the explanation. Still there is a possibility that I have misunderstood you. Please, correct me if this is the case.
I made a test for you, in which I have a predefined "Window" with some properties set. Then, I am mocking the "Application.Current.MainWindow" return value to return my predefined window. Finally, I assert my actual window has its properties set as my predefined window:
// Predefined window
Window expectedWindow =
expectedWindow.Width = 25;
expectedWindow.Height = 50;
Mock.Arrange(() => Application.Current.MainWindow).Returns(expectedWindow);
var actualWindow = Application.Current.MainWindow;
This test is passing as expected. Note that, with the commercial version of JustMock, you should not have any problems mocking the Application.Current.MainWindow.
Please, let me know if there is anything else I could help you with.
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums
, or our JustTrace