private void checkConstruction( Restriction restriction, DirectoryString res) { checkValues(restriction, res); restriction = Restriction.GetInstance(restriction); checkValues(restriction, res); Asn1InputStream aIn = new Asn1InputStream(restriction.ToAsn1Object().GetEncoded()); IAsn1String str = (IAsn1String) aIn.ReadObject(); restriction = Restriction.GetInstance(str); checkValues(restriction, res); }
public override void PerformTest() { DirectoryString res = new DirectoryString("test"); Restriction restriction = new Restriction(res.GetString()); checkConstruction(restriction, res); try { Restriction.GetInstance(new Object()); Fail("GetInstance() failed to detect bad object."); } catch (ArgumentException) { // expected } }
private void checkValues( Restriction restriction, DirectoryString res) { checkMandatoryField("restriction", res, restriction.RestrictionString); }