c# - xUnit Async Test in Callback -
this current test. succeeds, should obvious not do. how make test fail?
[fact] public async task executecallback() { timer timer = new timer(); timer.elapsed += (sender, e) => { new myclassundertest((param) => { assert.null(param); assert.notnull(param); timer.stop(); }); }; timer.interval = 500; timer.start(); system.threading.thread.sleep(1000); }
i want test inner logic of class (how executes provided action , parameters), , it's behavior when runs in eventhandler since tricky things threads.
as mentioned timer
event handler runs on different thread nunit test. thrown exception
not caught nunit, test succeeds.
Comments
Post a Comment