12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
/*************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. This code is licensed under the Visual Studio SDK license terms. THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. ***************************************************************************/ using System; using System.Text; using System.Collections.Generic; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VsSDK.UnitTestLibrary; using Microsoft.VisualStudio.Shell; using System.Collections; namespace Microsoft.VsSDK.UnitTestLibrary { public class RegistrationKeyMock : RegistrationAttribute.Key { private Hashtable _table = new Hashtable(); /// <summary> /// Constructor /// </summary> public RegistrationKeyMock() { } /// <summary> /// Collection of keys that are added. /// </summary> public Hashtable Keys { get { return _table; } } /// <summary> /// Close the key /// </summary> public override void Close() { return; } /// <summary> /// Create a sub key under the key with name /// </summary> /// <param name="name">name of the sub key</param> /// <returns>Key instance</returns> public override RegistrationAttribute.Key CreateSubkey(string name) { throw new NotImplementedException("The method or operation is not implemented."); } /// <summary> /// Set the reg key value /// </summary> /// <param name="valueName">name of the value</param> /// <param name="value">value</param> public override void SetValue(string valueName, object value) { string val = value.ToString().ToUpperInvariant(); string name = valueName.ToUpperInvariant(); if (!_table.Contains(name)) _table.Add(name, val); else _table[name] = val; } } }