void AddGetCheck <T>(T value) { string key = "key_" + new Random().Next(50000); QueryStringCollection collection = new QueryStringCollection(); collection.AddValue(key, value); Assert.True(collection.TryGetFirst <T>(key, out var result)); Assert.Equal(value, result); }
public void DateTimeTest() { string key = "key_" + new Random().Next(50000); QueryStringCollection collection = new QueryStringCollection(); DateTime time = DateTime.Now; collection.AddValue(key, time.ToString("o")); Assert.True(collection.TryGetFirst <DateTime>(key, out var result)); Assert.Equal(time, result); }