Test.CBORObjectTest.AssertWriteThrow C# (CSharp) Méthode

AssertWriteThrow() private static méthode

private static AssertWriteThrow ( CBORObject cbor ) : void
cbor CBORObject
Résultat void
        private static void AssertWriteThrow(CBORObject cbor)
        {
            try {
            cbor.WriteTo(null);
            Assert.Fail("Should have failed");
              } catch (ArgumentNullException) {
            new Object();
              } catch (Exception ex) {
            Assert.Fail(ex.ToString());
            throw new InvalidOperationException(String.Empty, ex);
              }
              try {
            CBORObject.Write(cbor, null);
            Assert.Fail("Should have failed");
              } catch (ArgumentNullException) {
            new Object();
              } catch (Exception ex) {
            Assert.Fail(ex.ToString());
            throw new InvalidOperationException(String.Empty, ex);
              }
        }
CBORObjectTest