public async Task WriteGenericStructICollectionWrapperT() { { GenericStructICollectionWrapper <int> obj = new GenericStructICollectionWrapper <int>() { 10, 20 }; Assert.Equal("[10,20]", await JsonSerializerWrapperForString.SerializeWrapper(obj)); } { GenericStructICollectionWrapper <int> obj = default; Assert.Equal("[]", await JsonSerializerWrapperForString.SerializeWrapper(obj)); } }
public static void WriteGenericStructICollectionWrapperT() { { GenericStructICollectionWrapper <int> obj = new GenericStructICollectionWrapper <int>() { 10, 20 }; Assert.Equal("[10,20]", JsonSerializer.Serialize(obj)); } { GenericStructICollectionWrapper <int> obj = default; Assert.Equal("[]", JsonSerializer.Serialize(obj)); } }
public void Initialize() { List = new GenericStructIListWrapper <int>() { 10 }; Collection = new GenericStructICollectionWrapper <int>() { 30 }; Set = new GenericStructISetWrapper <int>() { 50 }; Dictionary = new GenericStructIDictionaryWrapper <string, string>() { { "key1", "value1" } }; }