コード例 #1
0
 public void Initialize()
 {
     List = new StructWrapperForIList()
     {
         "Hello"
     };
     Dictionary = new StructWrapperForIDictionary {
         { "key1", "value1" }
     };
 }
コード例 #2
0
        public async Task WriteStructWrapperForIList()
        {
            {
                StructWrapperForIList obj = new StructWrapperForIList()
                {
                    1, "Hello"
                };
                Assert.Equal(@"[1,""Hello""]", await Serializer.SerializeWrapper(obj));
            }

            {
                StructWrapperForIList obj = default;
                Assert.Equal("[]", await Serializer.SerializeWrapper(obj));
            }
        }
コード例 #3
0
        public static void WriteStructWrapperForIList()
        {
            {
                StructWrapperForIList obj = new StructWrapperForIList()
                {
                    1, "Hello"
                };
                Assert.Equal(@"[1,""Hello""]", JsonSerializer.Serialize(obj));
            }

            {
                StructWrapperForIList obj = default;
                Assert.Equal("[]", JsonSerializer.Serialize(obj));
            }
        }