public void CustomAttributeElementTypeEncoder_SystemType() { var b = new BlobBuilder(); var e = new CustomAttributeElementTypeEncoder(b); Assert.Same(b, e.Builder); e.SystemType(); AssertEx.Equal(new byte[] { 0x50 }, b.ToArray()); }
static void EncodeType(CustomAttributeElementTypeEncoder typeEnc, Type type) { if (type == typeof(Type)) { typeEnc.SystemType(); } else { // Work out the primitive type code var primTypeCode = PrimitiveTypeCodeFromSystemTypeCode(type); typeEnc.PrimitiveType(primTypeCode); } }
public void CustomAttributeElementTypeEncoder_SystemType() { var b = new BlobBuilder(); var e = new CustomAttributeElementTypeEncoder(b); Assert.Same(b, e.Builder); e.SystemType(); AssertEx.Equal(new byte[] { 0x50 }, b.ToArray()); }