How to get properties which are set in the .testrunconfig\.testsettings file?

Mar 23, 2013 at 2:04 AM
Hi.

Thank you for MSTestExtensions.

I am wondering if it is possible to get the property values which are set in the .testrunconfig.testsettings file?

More specifically, I want to get the RelativePathRoot setting.
It is set to the solution directory by default.

So if I can get either the solution directory or the RelativePathRoot property value from within a TestAspect's SyncProcessMessage method, that would be perfect.

Directory.GetCurrentDirectory() returns the path of the test dll from where it is running.

Could it be in the "IMessage msg" parameter of the SyncProcessMessage method, which contains the following keys: __Uri __MethodName __MethodSignature __TypeName __Args __CallContext? If so, how can I access it?

Thank you! :)
Coordinator
Mar 25, 2013 at 3:10 PM
Hello,

I'm not sure I fully understand what you are looking for. I'm not aware of any property values in the ".testsettings" file, I've looked and I don't see any option to add them.

Additionally, "SyncProcessMessage" is a member on "System.Runtime.Remoting.Messaging.IMessage" so I don't have any control over it (it is part of the .NET Framework). I wouldn't be able to add anything to the "IMessage" keys (and probably shouldn't anyway).

If this is possible (and bear in mind I don't even know about or can see any property values in the ".testsettings" file), any such parameters would have to be exposed in a dictionary on the base class that you inherit from. Can you elaborate on these properties from the".testsettings" file?

BTW - MSTestExtensions is has moved. Find here: https://github.com/StealFocus/MSTestExtensions

And you can download an updated version (which works with any Visual Studio version) from NuGet: http://nuget.org/packages/StealFocus.MSTestExtensions

Regards,

Callum


On 23 March 2013 02:04, icnocop <notifications@codeplex.com> wrote:

From: icnocop

Hi.

Thank you for MSTestExtensions.

I am wondering if it is possible to get the property values which are set in the .testrunconfig.testsettings file?

More specifically, I want to get the RelativePathRoot setting.
It is set to the solution directory by default.

So if I can get either the solution directory or the RelativePathRoot property value from within a TestAspect's SyncProcessMessage method, that would be perfect.

Directory.GetCurrentDirectory() returns the path of the test dll from where it is running.

Could it be in the "IMessage msg" parameter of the SyncProcessMessage method, which contains the following keys: __Uri __MethodName __MethodSignature __TypeName __Args __CallContext? If so, how can I access it?

Thank you! :)

Read the full discussion online.

To add a post to this discussion, reply to this email (MSTestExtensions@discussions.codeplex.com)

To start a new discussion for this project, email MSTestExtensions@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Mar 26, 2013 at 2:17 AM
See the related discussion on github here.