Is it a part of your code? Would you like that the program will throw an exception when the \"else\" part execute?
if your answer to this is yes, then I suggest to create 2 different tests. One test will be dedicated to the \"if\" statement and the other to \"else\". In order for the test to pass when an exception is thrown, the following attribute needs to be added at the top of the specific method:
[ExpectedException(typeof(InvalidOperationException)),\" your message\"]
P.S The string part is not mandatory.
Hope I understood correctly.
Please feel free to write to us.