Parameters
- name
Library/Library.Test/TestStorage.cs
C# | Copy Code |
---|---|
Version data = new Version(1, 2, 3, 4); Store.SetValue("a", data); Assert.AreEqual(data, Store.GetValue("a", (Version)null)); Store.Delete("a"); Assert.AreEqual(new Version(1, 0), Store.GetValue("a", new Version(1, 0))); Store.SetValue("a", data); Assert.AreEqual(data, Store.GetValue("a", (Version)null)); Store.SetValue("a", (string)null);//set null will delete Assert.AreEqual(new Version(1, 0), Store.GetValue("a", new Version(1, 0))); |
VB.NET | Copy Code |
---|---|
Dim data As New Version(1, 2, 3, 4) Store.SetValue("a", data) Assert.AreEqual(data, Store.GetValue("a", DirectCast(Nothing, Version))) Store.Delete("a") Assert.AreEqual(New Version(1, 0), Store.GetValue("a", New Version(1, 0))) Store.SetValue("a", data) Assert.AreEqual(data, Store.GetValue("a", DirectCast(Nothing, Version))) Store.SetValue("a", DirectCast(Nothing, String)) 'set null will delete Assert.AreEqual(New Version(1, 0), Store.GetValue("a", New Version(1, 0))) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7