public void FormatValueToFilter_X509CertificateCollection_ThrowsNotSupportedException() { //prepare var certs = new[] { new X509Certificate(Resources.cert), new X509Certificate(Resources.cert) }; var propertyMapping = new X509Certificate2CollectionPropertyMapping <X509Certificate2CollectionPropertyMappingTest>(_mappingArguments); //act Executing.This(() => propertyMapping.FormatValueToFilter(certs)) .Should().Throw <NotSupportedException>(); }
public void FormatValueToFilter_X509Certificate2Collection_ThrowsNotSupportedException() { //prepare var certs = new Collection <X509Certificate2>(new[] { new X509Certificate2(Resources.ResourceHelper.GetAssemblyResource(@"Resources\cert.cer")), new X509Certificate2(Resources.ResourceHelper.GetAssemblyResource(@"Resources\cert.cer")) }); var propertyMapping = new X509Certificate2CollectionPropertyMapping <X509Certificate2CollectionPropertyMappingTest>(_mappingArguments); //act Executing.This(() => propertyMapping.FormatValueToFilter(certs)) .Should().Throw <NotSupportedException>(); }
public void FormatValueToFilter_X509Certificate_ReturnsStringOctet() { //prepare var certs = new X509Certificate(Resources.cert); var propertyMapping = new X509Certificate2CollectionPropertyMapping <X509Certificate2CollectionPropertyMappingTest>(_mappingArguments); //act var value = propertyMapping.FormatValueToFilter(certs); //assert value.Should().Be.EqualTo(certs.GetRawCertData().ToStringOctet()); }