Я получаю следующую ошибку с кодом ниже:
x.system.notsupportedexception: unsupported aspressent: x => x.s.temprintexception: unsupport xpressent: x.s.tomprintexcretexceptexceptexceptexceptexception: nusOpported: x.s.temprintexception: nuspported: x. /> Неопрашиваемые участники (здесь: CerticateProperties.get_x509thumbprint) не могут использоваться в выражениях настройки /проверки.
Код: Выделить всё
var azCertificateProps = new Mock();
azCertificateProps.SetupGet(x => x.X509Thumbprint).Returns(testThumbprint); // Fails here
var azCertificate = new Mock(azCertificateProps.Object);
< /code>
Для справки, это фактический код (упрощенный) Я пытаюсь пройти модульный тест < /p>
public KeyVaultCertificateWithPolicy ExpectedCertificate { get; set; }
public async Task ValidateCertificate(X509Certificate2 clientCertificate, CancellationToken cancellationToken)
{
return clientCertificate.Thumbprint == BitConverter.ToString(ExpectedCertificate.Properties.X509Thumbprint).Replace("-", "");
}
Подробнее здесь: https://stackoverflow.com/questions/777 ... thumbprint
Мобильная версия