Esempio n. 1
0
        public override void PerformTest()
        {
            AdditionalInformationSyntax syntax = new AdditionalInformationSyntax("hello world");

            checkConstruction(syntax, new DirectoryString("hello world"));

            try
            {
                AdditionalInformationSyntax.GetInstance(new Object());

                Fail("GetInstance() failed to detect bad object.");
            }
            catch (ArgumentException)
            {
                // expected
            }
        }
Esempio n. 2
0
        private void checkConstruction(
            AdditionalInformationSyntax syntax,
            DirectoryString information)
        {
            checkValues(syntax, information);

            syntax = AdditionalInformationSyntax.GetInstance(syntax);

            checkValues(syntax, information);

            Asn1InputStream aIn = new Asn1InputStream(syntax.ToAsn1Object().GetEncoded());

            IAsn1String info = (IAsn1String)aIn.ReadObject();

            syntax = AdditionalInformationSyntax.GetInstance(info);

            checkValues(syntax, information);
        }
Esempio n. 3
0
 private void checkValues(
     AdditionalInformationSyntax syntax,
     DirectoryString information)
 {
     checkMandatoryField("information", information, syntax.Information);
 }