コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Parameterized.Parameters(name = "{0}") public static Iterable<WriteTest> data()
        public static IEnumerable <WriteTest> Data()
        {
            return(Arrays.asList(shouldWrite(true, true), shouldWrite(false, false), shouldWrite(( sbyte )0, ( sbyte )0), shouldWrite(( sbyte )42, ( sbyte )42), shouldWrite(( short )42, ( short )42), shouldWrite(42, 42), shouldWrite(42L, 42L), shouldWrite(42.0f, 42.0f), shouldWrite(42.0, 42.0), shouldWrite('x', 'x'), shouldWrite("Hi", "Hi"), shouldWrite(Values.NoValue, ( object )null), shouldWrite(Values.PointValue(CoordinateReferenceSystem.Cartesian, 1, 2), Values.PointValue(CoordinateReferenceSystem.Cartesian, 1, 2)), shouldWrite(Values.PointValue(CoordinateReferenceSystem.Wgs84, 1, 2), Values.PointValue(CoordinateReferenceSystem.Wgs84, 1, 2)), shouldWrite(LocalDate.of(1991, 10, 18), DateValue.Date(1991, 10, 18)), shouldWrite(new sbyte[] { 1, 2, 3 }, byteArray(new sbyte[] { 1, 2, 3 })), shouldWrite(new short[] { 1, 2, 3 }, beginArray(3, SHORT), ( short )1, ( short )2, ( short )3, endArray()), shouldWrite(new int[] { 1, 2, 3 }, beginArray(3, INT), 1, 2, 3, endArray()), shouldWrite(new long[] { 1, 2, 3 }, beginArray(3, LONG), 1L, 2L, 3L, endArray()), shouldWrite(new float[] { 1, 2, 3 }, beginArray(3, FLOAT), 1.0f, 2.0f, 3.0f, endArray()), shouldWrite(new double[] { 1, 2, 3 }, beginArray(3, DOUBLE), 1.0, 2.0, 3.0, endArray()), shouldWrite(new char[] { 'a', 'b' }, beginArray(2, CHAR), 'a', 'b', endArray()), shouldWrite(new string[] { "a", "b" }, beginArray(2, STRING), "a", "b", endArray()), shouldWrite(new bool[] { true, false }, beginArray(2, BOOLEAN), true, false, endArray()), shouldWrite(new DateTime[] { new DateTime(1991, 10, 18, 6, 37, 0, 0), new DateTime(1992, 10, 18, 6, 37, 0, 0) }, beginArray(2, LOCAL_DATE_TIME), LocalDateTimeValue.LocalDateTime(1991, 10, 18, 6, 37, 0, 0), LocalDateTimeValue.LocalDateTime(1992, 10, 18, 6, 37, 0, 0), endArray()), shouldWrite(new sbyte[] { 1, 2, 3 }, byteArray(new sbyte[] { 1, 2, 3 }))));
        }
コード例 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void writeLocalDateTime(java.time.LocalDateTime localDateTime) throws RuntimeException
        public override void WriteLocalDateTime(DateTime localDateTime)
        {
            Buffer.Add(LocalDateTimeValue.LocalDateTime(localDateTime));
        }