I need to have my X509Certificate2.Subject return gibberish for code coverage in unit tests. I've tried using Moq, but it fails because Subject is not a virtual method. Is there a way to do this, or do I have to re-invent the wheel here?
Mock<X509Certificate2> mockCert = new Mock<X509Certificate2>(contextAccessor.Certificate.RawData);
mockCert.Setup(m=>m.Subject).Returns("kjewnr,mwnzlxkcuvlkrj,wmelq");
mockCert.CallBase = true;
contextAccessor.Certificate = mockCert.Object;
authenticatorAccessor.LogAuthentication(context);
Can Moq do this? If not, are there other libraries that will work for me? Thanks.