Author: rolf
Date: 2007-01-15 04:15:58 -0500 (Mon, 15 Jan 2007)
New Revision: 71011

Added:
   trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/
   trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/ChangeLog
   
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/ClipboardProxyTest.cs
   
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/FileSystemProxyTest.cs
   
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/RegistryProxyTest.cs
   
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/SpecialDirectoriesProxyTest.cs
Log:
2007-01-15  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>

        * Added ClipboardProxyTest.cs, FileSystemProxyTest.cs, 
        RegistryProxyTest.cs, SpecialDirectoriesProxyTest.cs


Added: 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/ChangeLog
===================================================================
--- trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/ChangeLog  
2007-01-15 09:15:24 UTC (rev 71010)
+++ trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/ChangeLog  
2007-01-15 09:15:58 UTC (rev 71011)
@@ -0,0 +1,4 @@
+2007-01-15  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
+
+       * Added ClipboardProxyTest.cs, FileSystemProxyTest.cs, 
+       RegistryProxyTest.cs, SpecialDirectoriesProxyTest.cs
\ No newline at end of file

Added: 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/ClipboardProxyTest.cs
===================================================================
--- 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/ClipboardProxyTest.cs
      2007-01-15 09:15:24 UTC (rev 71010)
+++ 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/ClipboardProxyTest.cs
      2007-01-15 09:15:58 UTC (rev 71011)
@@ -0,0 +1,41 @@
+// ClipboardProxyTest.cs - NUnit Test Cases for 
Microsoft.VisualBasic.MyServices.ClipboardProxy
+//
+// Rolf Bjarne Kvinge  ([EMAIL PROTECTED])
+//
+// 
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using Microsoft.VisualBasic.MyServices;
+
+namespace MonoTests.Microsoft_VisualBasic.MyServices
+{
+       [TestFixture]
+       public class ClipboardProxyTest
+       {
+       }
+}
+#endif
\ No newline at end of file

Added: 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/FileSystemProxyTest.cs
===================================================================
--- 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/FileSystemProxyTest.cs
     2007-01-15 09:15:24 UTC (rev 71010)
+++ 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/FileSystemProxyTest.cs
     2007-01-15 09:15:58 UTC (rev 71011)
@@ -0,0 +1,41 @@
+// FileSystemProxyTest.cs - NUnit Test Cases for 
Microsoft.VisualBasic.MyServices.FileSystemProxy
+//
+// Rolf Bjarne Kvinge  ([EMAIL PROTECTED])
+//
+// 
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using Microsoft.VisualBasic.MyServices;
+
+namespace MonoTests.Microsoft_VisualBasic.MyServices
+{
+       [TestFixture]
+       public class FileSystemProxyTest
+       {
+       }
+}
+#endif
\ No newline at end of file

Added: 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/RegistryProxyTest.cs
===================================================================
--- 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/RegistryProxyTest.cs
       2007-01-15 09:15:24 UTC (rev 71010)
+++ 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/RegistryProxyTest.cs
       2007-01-15 09:15:58 UTC (rev 71011)
@@ -0,0 +1,116 @@
+// RegistryProxyTest.cs - NUnit Test Cases for 
Microsoft.VisualBasic.MyServices.RegistryProxy
+//
+// Rolf Bjarne Kvinge  ([EMAIL PROTECTED])
+//
+// 
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using Microsoft.VisualBasic.MyServices;
+
+namespace MonoTests.Microsoft_VisualBasic.MyServices
+{
+       [TestFixture]
+       public class RegistryProxyTest
+       {
+               [Test]
+               public void TestGetValue ()
+               {
+                       Microsoft.VisualBasic.MyServices.RegistryProxy registry 
= getProxy ();
+                       object value = registry.GetValue ("HKEY_CLASSES_ROOT", 
".txt", "a");
+                       Assert.AreEqual ("a", value, "#01");
+               }
+               
+               [Test]
+               public void TestSetValue ()
+               {
+                       Microsoft.VisualBasic.MyServices.RegistryProxy registry 
= getProxy ();
+                       string name = ".someweirdthing";
+                       string keyname = "HKEY_CLASSES_ROOT\\" + name;
+                       string valuename = ".name";
+                       registry.SetValue (keyname, valuename, "a");
+                       object value = registry.GetValue (keyname, valuename, 
"b");
+                       Assert.AreEqual ("a", value, "#01");
+                       registry.SetValue (keyname, valuename, "c");
+                       value = registry.GetValue (keyname, valuename, "c");
+                       Assert.AreEqual ("c", value, "#02");
+                       
+                       registry.ClassesRoot.DeleteSubKey(name);
+               }
+               
+               [Test]
+               public void TestSetValue2 ()
+               {
+                       Microsoft.VisualBasic.MyServices.RegistryProxy registry 
= getProxy ();
+                       string name = ".someweirdthing";
+                       string keyname = "HKEY_CLASSES_ROOT\\" + name;
+                       string valuename = ".name";
+                       registry.SetValue (keyname, valuename, 1);
+                       object value = registry.GetValue (keyname, valuename, 
2);
+                       Assert.AreEqual (1, value, "#01");
+                       registry.SetValue (keyname, valuename, 3, 
Microsoft.Win32.RegistryValueKind.DWord);
+                       value = registry.GetValue (keyname, valuename, 3);
+                       Assert.AreEqual (3, value, "#02");
+                       
+                       registry.ClassesRoot.DeleteSubKey(name);
+               }
+               
+               [Test]
+               public void TestGlobalKeys ()
+               {
+                       Microsoft.Win32.RegistryKey classes, currentconfig, 
currentuser, dyndata, localmachine, perfdata, users;
+                       Microsoft.VisualBasic.MyServices.RegistryProxy registry 
= getProxy ();
+                       
+                       classes = registry.ClassesRoot;
+                       Assert.AreEqual ("HKEY_CLASSES_ROOT", classes.Name, 
"ClassesRoot");
+                       
+                       currentconfig = registry.CurrentConfig;
+                       Assert.AreEqual ("HKEY_CURRENT_CONFIG", 
currentconfig.Name, "CurrentConfig");
+                       
+                       currentuser = registry.CurrentUser;
+                       Assert.AreEqual ("HKEY_CURRENT_USER", currentuser.Name, 
"CurrentUser");
+                       
+                       dyndata = registry.DynData;
+                       Assert.AreEqual ("HKEY_DYN_DATA", dyndata.Name, 
"DynData");
+                       
+                       localmachine = registry.LocalMachine;
+                       Assert.AreEqual ("HKEY_LOCAL_MACHINE", 
localmachine.Name, "LocalMachine");
+                       
+                       perfdata = registry.PerformanceData;
+                       Assert.AreEqual ("HKEY_PERFORMANCE_DATA", 
perfdata.Name, "PerformanceData");
+                       
+                       users = registry.Users;
+                       Assert.AreEqual ("HKEY_USERS", users.Name, "Users");
+                       
+               }
+               
+               Microsoft.VisualBasic.MyServices.RegistryProxy getProxy ()
+               {
+                       return (new 
Microsoft.VisualBasic.Devices.Computer()).Registry;
+               }
+       }
+}
+#endif
\ No newline at end of file

Added: 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/SpecialDirectoriesProxyTest.cs
===================================================================
--- 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/SpecialDirectoriesProxyTest.cs
     2007-01-15 09:15:24 UTC (rev 71010)
+++ 
trunk/mono-basic/vbruntime/Test/Microsoft.VisualBasic.MyServices/SpecialDirectoriesProxyTest.cs
     2007-01-15 09:15:58 UTC (rev 71011)
@@ -0,0 +1,65 @@
+// SpecialDirectoriesProxyTest.cs - NUnit Test Cases for 
Microsoft.VisualBasic.MyServices.SpecialDirectoriesProxy
+//
+// Rolf Bjarne Kvinge  ([EMAIL PROTECTED])
+//
+// 
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using Microsoft.VisualBasic.MyServices;
+
+namespace MonoTests.Microsoft_VisualBasic.MyServices
+{
+       [TestFixture]
+       public class SpecialDirectoriesProxyTest
+       {
+               [Test]
+               public void PathTest()
+               {
+                       Microsoft.VisualBasic.Devices.Computer pc = new 
Microsoft.VisualBasic.Devices.Computer();
+                       
Microsoft.VisualBasic.MyServices.SpecialDirectoriesProxy sd = 
pc.FileSystem.SpecialDirectories;
+                       Assert.AreEqual (sd.AllUsersApplicationData, 
RemoveBS(System.Windows.Forms.Application.CommonAppDataPath), 
"AllUserApplicationData");
+                       Assert.AreEqual (sd.CurrentUserApplicationData, 
RemoveBS(System.Windows.Forms.Application.UserAppDataPath), 
"CurrentUserApplicationData");
+                       Assert.AreEqual (sd.Desktop, 
RemoveBS(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)), 
"Desktop");
+                       Assert.AreEqual (sd.MyDocuments, 
RemoveBS(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)), 
"MyDocuments");
+                       Assert.AreEqual (sd.MyMusic, 
RemoveBS(Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)), 
"MyMusic");
+                       Assert.AreEqual (sd.MyPictures, 
RemoveBS(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)), 
"MyPictures");
+                       Assert.AreEqual (sd.ProgramFiles, 
RemoveBS(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)), 
"ProgramFiles");
+                       Assert.AreEqual (sd.Programs, 
RemoveBS(Environment.GetFolderPath(Environment.SpecialFolder.Programs)), 
"Programs");
+                       Assert.AreEqual (sd.Temp, 
RemoveBS(System.IO.Path.GetTempPath()), "Temp");
+               }
+               
+               string RemoveBS (string path) 
+               {
+                       if 
(path.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString())) 
+                               return path.Substring (0, path.Length -1);
+                       else {
+                               return path;
+                       }
+               }
+       }
+}
+#endif
\ No newline at end of file

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to