5 public static class Program
7 public const string UnicodeLowSurrogate
= "l\uDC00";
8 public const string UnicodeHighSurrogate
= "h\uD800";
9 public const string UnicodeReplacementCharacter
= "\uFFFD";
11 public static int Main ()
16 ( typeof (Program
), "0074 0065 0073 0074" ),
17 ( typeof (A
), "0068 FFFD FFFD" ),
18 ( typeof (B
), "006C FFFD FFFD" ),
19 ( typeof (C
), "006C FFFD FFFD 0068 FFFD FFFD" ),
20 ( typeof (D
), "0068 FFFD FFFD 006C FFFD FFFD" )
23 foreach (var tup
in tuples
) {
25 var a
= ((ObsoleteAttribute
)type
.GetCustomAttributes(true)[0]);
28 var sb
= new StringBuilder();
32 sb
.AppendFormat("{0:X4} ", (uint)ch
);
37 var expected
= tup
.Item2
;
38 var actual
= sb
.ToString().Trim();
39 if (actual
!= expected
) {
40 Console
.WriteLine("Attribute on type {0} failed to decode:", type
);
41 Console
.WriteLine(" expected '{0}' but got '{1}'", expected
, actual
);
44 Console
.WriteLine("{0} {1}", type
, actual
);
52 [Obsolete(Program
.UnicodeHighSurrogate
)]
56 [Obsolete(Program
.UnicodeLowSurrogate
)]
60 [Obsolete(Program
.UnicodeLowSurrogate
+ Program
.UnicodeHighSurrogate
)]
64 [Obsolete(Program
.UnicodeHighSurrogate
+ Program
.UnicodeLowSurrogate
)]