I tried to use JustMock Replace technique to replace the Print method of System.Drawing.Printing.PrintDocument.
In class Initialize
and in my unit test method arranged the PrintDocument.Print as follows:
When PrintDocument object instatiated under the class to be tested, it throws the following exception when calling the PrintDocument.Print method
Could not load file or assembly 'Telerik.CodeWeaver.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87210992829a189d' or one of its dependencies. The system cannot find the file specified.
This error occurs when running the test using MSTest runner, but if I used JustCode test runner everything run ok and no exception thrown
And no errors in the event viewer regarding the profiler:
.NET Runtime version 4.0.30319.17929 - The profiler was loaded successfully. Profiler CLSID: '{b7abe522-a68f-44f2-925b-81e7488e9ec0}'. Process ID (decimal): 6368. Message ID: [0x2507].
Is this a problem whenmocking the System.Drawing.Printing.PrintDocument?
Please help I am facing many troubles with JustMock and my unit tests using MSTest runner.
If this a test runner problem, do you suggest a replacement?
In class Initialize
Mock.Replace<System.Drawing.Printing.PrintDocument>(p => p.Print()).In<PrintJobTest>(t => t.Ensure_Print_Job_Folder_Name());
and in my unit test method arranged the PrintDocument.Print as follows:
var printDocument =
new
System.Drawing.Printing.PrintDocument();
Mock.Arrange(() => printDocument.Print()).IgnoreInstance().DoNothing();
When PrintDocument object instatiated under the class to be tested, it throws the following exception when calling the PrintDocument.Print method
Could not load file or assembly 'Telerik.CodeWeaver.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87210992829a189d' or one of its dependencies. The system cannot find the file specified.
This error occurs when running the test using MSTest runner, but if I used JustCode test runner everything run ok and no exception thrown
And no errors in the event viewer regarding the profiler:
.NET Runtime version 4.0.30319.17929 - The profiler was loaded successfully. Profiler CLSID: '{b7abe522-a68f-44f2-925b-81e7488e9ec0}'. Process ID (decimal): 6368. Message ID: [0x2507].
Is this a problem whenmocking the System.Drawing.Printing.PrintDocument?
Please help I am facing many troubles with JustMock and my unit tests using MSTest runner.
If this a test runner problem, do you suggest a replacement?