visual studio 2013 - How do I get Intellisense inside Behavior classes using MSpec? -
i´m using mspec-framework implement bdd our new project. i´m new concept of bdd , therefore mspec , have problems adress object of interest (_obj2 in example), @ least visual studio intellisense doesn't propose in behavior-class
, inside should_do_some_fancy_magic
-context.
namespace examplespace{ public partial class exampleclass{ private objectofanotherclass _obj2 private void test(objectofanotherclass _co) ... } } namespace examplespace.test{ [behaviors] class exampleclassbehavior{ establish context =()=>{...}; should_do_some_fancy_magic() =()=> shouldbeequal(examplevalue, _ex.test(_ex._obj2); private static exampleclass _ex; } }
any ideas how intellisense working inside behavior-class
?
you don't need set [behaviors]
context. behaviors used reuse it
s between contexts. that's use-case comes infrequently.
this should work, despite being untested:
namespace examplespace{ public partial class exampleclass { public void test(objectofanotherclass _co) _co.foobar = 42; } } namespace examplespace.test { [subject(typeof(exampleclass))] // optional. class when_something_happens { static objectofanotherclass other; static exampleclassother systemundertest ; establish context = () => { other = new objectofanotherclass(); systemundertest = new exampleclass(); } because of = () => { systemundertest.test(other); } should_do_some_fancy_magic() = () => other.foobar.shouldequal(42); } }
you can have @ some mspec samples here.
Comments
Post a Comment