public void TestLoadOrCreteMoniker(IIpcProvider provider) { var monikerId = "some arbitrary string"; var moniker = provider.LoadOrCreateMoniker(monikerId); XAssert.AreEqual(monikerId, moniker.Id); var monikerClone = provider.LoadOrCreateMoniker(monikerId); XAssert.AreEqual(moniker, monikerClone); XAssert.AreEqual(moniker.GetHashCode(), monikerClone.GetHashCode()); var differentMoniker = provider.CreateNewMoniker(); XAssert.AreNotEqual(moniker, differentMoniker); XAssert.AreNotEqual(moniker.GetHashCode(), differentMoniker.GetHashCode()); }
/// <summary> /// First calls <see cref="IIpcProvider.LoadOrCreateMoniker(string)"/>, then /// <see cref="IIpcProvider.RenderConnectionString(IIpcMoniker)"/> on the returned moniker. /// </summary> public static string LoadAndRenderMoniker(this IIpcProvider ipcProvider, string monikerId) { return(ipcProvider.RenderConnectionString(ipcProvider.LoadOrCreateMoniker(monikerId))); }