Page 1 of 1

isSetup/isTeardown property usage

Posted: Mon Feb 24, 2014 9:00 am
by odklizec
Hi,

I have a problem with declaring isSetup/isTeardown property (to detect if the module is in Setup/Teardown section). I'm quite sure it's because of my limited knowledge of C# ;) Any help will be greatly appreciated.

Here is what I've tried so far:
IModule module;
bool isModule = module.isSetup;
This throws me an error "Use of unassigned local variable 'module' (CS0165)"

So I tried this:
IModule module = Ranorex.Core.Testing.IModule;
bool isModule = module.isSetup;
This returns error "'Ranorex.Core.Testing.IModule' is a 'type', which is not valid in the given context (CS0119)"

The interesting thing is, that module is correctly recognized (in both examples) by the code completion and offers both isSetup and isTeardown properties.

Could you please guide me to the right direction? Thank you!

Re: isSetup/isTeardown property usage

Posted: Wed Feb 26, 2014 8:28 am
by odklizec
Hi folks,

Does anyone have any idea? I'm really stuck with this :(

Re: isSetup/isTeardown property usage

Posted: Wed Feb 26, 2014 11:24 am
by Support Team
Hi odklizec,

In order to access the “isSetup”- and “isTeardown”-property please use following code:
var module = (TestSuiteModule)TestSuiteModule.Current;
			bool a = module.IsSetup;
			bool b = module.IsTeardown;
Regards,
Robert

Re: isSetup/isTeardown property usage

Posted: Wed Feb 26, 2014 11:50 am
by odklizec
Hi Robert,

Thank you for the help! Maybe it's just my inexperience with C#, but I think it would be good to have some examples in API docu ;) Sometimes it's really hard to figure things out just from plain API description.

Re: isSetup/isTeardown property usage

Posted: Fri Feb 28, 2014 4:51 pm
by Support Team
Hi odklizec,

Unfortunately there are some non-public methods which are not documented. These methods can be changed every time by Ranorex therefore it’s not recommended to use them. Thank you for your understanding.

Regards,
Robert