Nunit unit test for WPF application gives NullReference exception -


while writing unit test(nunit) wpf application. got error 'object reference not set instance'

at bottom level can see line raise exception

 application.current.dispatcher.invoke(dispatcherpriority.send,           new action(() => loc.resolvelocalizedvalue(out ui))); 

this code used in helper class library. in advance. guys please suggest how can resolve this.

application.current null in case. returns application object current appdomain gets set when application run.

test cases test business logic i.e. test viewmodel layer. code want test should not contain reference ui component.


more details can found here - application.current null in unit test cases. workaround provided in link discourage use of application.current in testcases or usage of in viewmodel layer needs unit tested.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -