OLD | NEW |
1 #region Copyright notice and license | 1 #region Copyright notice and license |
2 // Protocol Buffers - Google's data interchange format | 2 // Protocol Buffers - Google's data interchange format |
3 // Copyright 2015 Google Inc. All rights reserved. | 3 // Copyright 2015 Google Inc. All rights reserved. |
4 // https://developers.google.com/protocol-buffers/ | 4 // https://developers.google.com/protocol-buffers/ |
5 // | 5 // |
6 // Redistribution and use in source and binary forms, with or without | 6 // Redistribution and use in source and binary forms, with or without |
7 // modification, are permitted provided that the following conditions are | 7 // modification, are permitted provided that the following conditions are |
8 // met: | 8 // met: |
9 // | 9 // |
10 // * Redistributions of source code must retain the above copyright | 10 // * Redistributions of source code must retain the above copyright |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 public static TestAllTypes CreateFullTestAllTypes() | 47 public static TestAllTypes CreateFullTestAllTypes() |
48 { | 48 { |
49 return new TestAllTypes | 49 return new TestAllTypes |
50 { | 50 { |
51 SingleBool = true, | 51 SingleBool = true, |
52 SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), | 52 SingleBytes = ByteString.CopyFrom(1, 2, 3, 4), |
53 SingleDouble = 23.5, | 53 SingleDouble = 23.5, |
54 SingleFixed32 = 23, | 54 SingleFixed32 = 23, |
55 SingleFixed64 = 1234567890123, | 55 SingleFixed64 = 1234567890123, |
56 SingleFloat = 12.25f, | 56 SingleFloat = 12.25f, |
57 SingleForeignEnum = ForeignEnum.FOREIGN_BAR, | 57 SingleForeignEnum = ForeignEnum.ForeignBar, |
58 SingleForeignMessage = new ForeignMessage { C = 10 }, | 58 SingleForeignMessage = new ForeignMessage { C = 10 }, |
59 SingleImportEnum = ImportEnum.IMPORT_BAZ, | 59 SingleImportEnum = ImportEnum.ImportBaz, |
60 SingleImportMessage = new ImportMessage { D = 20 }, | 60 SingleImportMessage = new ImportMessage { D = 20 }, |
61 SingleInt32 = 100, | 61 SingleInt32 = 100, |
62 SingleInt64 = 3210987654321, | 62 SingleInt64 = 3210987654321, |
63 SingleNestedEnum = TestAllTypes.Types.NestedEnum.FOO, | 63 SingleNestedEnum = TestAllTypes.Types.NestedEnum.Foo, |
64 SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb
= 35 }, | 64 SingleNestedMessage = new TestAllTypes.Types.NestedMessage { Bb
= 35 }, |
65 SinglePublicImportMessage = new PublicImportMessage { E = 54 }, | 65 SinglePublicImportMessage = new PublicImportMessage { E = 54 }, |
66 SingleSfixed32 = -123, | 66 SingleSfixed32 = -123, |
67 SingleSfixed64 = -12345678901234, | 67 SingleSfixed64 = -12345678901234, |
68 SingleSint32 = -456, | 68 SingleSint32 = -456, |
69 SingleSint64 = -12345678901235, | 69 SingleSint64 = -12345678901235, |
70 SingleString = "test", | 70 SingleString = "test", |
71 SingleUint32 = UInt32.MaxValue, | 71 SingleUint32 = UInt32.MaxValue, |
72 SingleUint64 = UInt64.MaxValue, | 72 SingleUint64 = UInt64.MaxValue, |
73 RepeatedBool = { true, false }, | 73 RepeatedBool = { true, false }, |
74 RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.Co
pyFrom(5, 6), ByteString.CopyFrom(new byte[1000]) }, | 74 RepeatedBytes = { ByteString.CopyFrom(1, 2, 3, 4), ByteString.Co
pyFrom(5, 6), ByteString.CopyFrom(new byte[1000]) }, |
75 RepeatedDouble = { -12.25, 23.5 }, | 75 RepeatedDouble = { -12.25, 23.5 }, |
76 RepeatedFixed32 = { UInt32.MaxValue, 23 }, | 76 RepeatedFixed32 = { UInt32.MaxValue, 23 }, |
77 RepeatedFixed64 = { UInt64.MaxValue, 1234567890123 }, | 77 RepeatedFixed64 = { UInt64.MaxValue, 1234567890123 }, |
78 RepeatedFloat = { 100f, 12.25f }, | 78 RepeatedFloat = { 100f, 12.25f }, |
79 RepeatedForeignEnum = { ForeignEnum.FOREIGN_FOO, ForeignEnum.FOR
EIGN_BAR }, | 79 RepeatedForeignEnum = { ForeignEnum.ForeignFoo, ForeignEnum.Fore
ignBar }, |
80 RepeatedForeignMessage = { new ForeignMessage(), new ForeignMess
age { C = 10 } }, | 80 RepeatedForeignMessage = { new ForeignMessage(), new ForeignMess
age { C = 10 } }, |
81 RepeatedImportEnum = { ImportEnum.IMPORT_BAZ, ImportEnum.IMPORT_
ENUM_UNSPECIFIED }, | 81 RepeatedImportEnum = { ImportEnum.ImportBaz, ImportEnum.Unspecif
ied }, |
82 RepeatedImportMessage = { new ImportMessage { D = 20 }, new Impo
rtMessage { D = 25 } }, | 82 RepeatedImportMessage = { new ImportMessage { D = 20 }, new Impo
rtMessage { D = 25 } }, |
83 RepeatedInt32 = { 100, 200 }, | 83 RepeatedInt32 = { 100, 200 }, |
84 RepeatedInt64 = { 3210987654321, Int64.MaxValue }, | 84 RepeatedInt64 = { 3210987654321, Int64.MaxValue }, |
85 RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.FOO, TestAl
lTypes.Types.NestedEnum.NEG }, | 85 RepeatedNestedEnum = { TestAllTypes.Types.NestedEnum.Foo, TestAl
lTypes.Types.NestedEnum.Neg }, |
86 RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage {
Bb = 35 }, new TestAllTypes.Types.NestedMessage { Bb = 10 } }, | 86 RepeatedNestedMessage = { new TestAllTypes.Types.NestedMessage {
Bb = 35 }, new TestAllTypes.Types.NestedMessage { Bb = 10 } }, |
87 RepeatedPublicImportMessage = { new PublicImportMessage { E = 54
}, new PublicImportMessage { E = -1 } }, | 87 RepeatedPublicImportMessage = { new PublicImportMessage { E = 54
}, new PublicImportMessage { E = -1 } }, |
88 RepeatedSfixed32 = { -123, 123 }, | 88 RepeatedSfixed32 = { -123, 123 }, |
89 RepeatedSfixed64 = { -12345678901234, 12345678901234 }, | 89 RepeatedSfixed64 = { -12345678901234, 12345678901234 }, |
90 RepeatedSint32 = { -456, 100 }, | 90 RepeatedSint32 = { -456, 100 }, |
91 RepeatedSint64 = { -12345678901235, 123 }, | 91 RepeatedSint64 = { -12345678901235, 123 }, |
92 RepeatedString = { "foo", "bar" }, | 92 RepeatedString = { "foo", "bar" }, |
93 RepeatedUint32 = { UInt32.MaxValue, UInt32.MinValue }, | 93 RepeatedUint32 = { UInt32.MaxValue, UInt32.MinValue }, |
94 RepeatedUint64 = { UInt64.MaxValue, UInt32.MinValue }, | 94 RepeatedUint64 = { UInt64.MaxValue, UInt32.MinValue }, |
95 OneofString = "Oneof string" | 95 OneofString = "Oneof string" |
96 }; | 96 }; |
97 } | 97 } |
98 } | 98 } |
99 } | 99 } |
OLD | NEW |