I am fiddling around trying to install an application via ClickOnce - with certain minimum permissions. I'd like to unit test to assert that my application does not use any additional functionality disallowed by the wanted security policy.
Can I in my unit test specify that I want to use the specified manifest to regulate permissions, make calls to my library and then assert that no security exceptions are thrown?
If so, how?
Thanks!
If you want to unit test (test in isolation) you have to
Test SecurityManager for permissionLogic
you can extract the permissionLogic to a class of its own with methods
then you write unit tests
Contrologic (i.e. MVVM) uses permission logic
create a mock-SecurityManager that always allow/disallow functionality. and write unit tests for the controller if it reacts as expected.
I am not shure if there is an easy way to create an integration-test where Click-Once-App actually uses the real SecurityManager and the result gets verified.
Update after getting more infos on what the goal is
write unit tests for the controller if it reacts as expected.