public void Initialize()
 {
     List = new StructWrapperForIList()
     {
         "Hello"
     };
     Dictionary = new StructWrapperForIDictionary {
         { "key1", "value1" }
     };
 }
        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));
            }
        }