I'm currently unit testing .NET application with NUnit framework.
Some of the methods we use involve getting X509Certificate2 object as input and checking if one or more properties match certain crateria.
For example, method that check whether the thumbprint exists in a very specific list.
Thus, I need a way to mock or fake the X509Certificate2 object so that I can control what the thumbprint field will return or what are the extentions list will contain.
One way I can approach this is to create the special certificates and use them as resources in the tests project (hard coded or embedded resource).
I'm searching for a different solution, if it's even possible.
And suggestions will be greatly appreciated! Thanks in advance :)