/// <summary> /// Checks whether or not a queue is local by its path. /// </summary> /// <param name="value">The path to the queue to check.</param> /// <returns>true if the queue is local, otherwise false.</returns> public static bool QueueIsLocal(string value) { var machineName = Environment.MachineName.ToLower(); value = value.ToLower().Replace(PREFIX.ToLower(), ""); var index = value.IndexOf('\\'); var queueMachineName = value.Substring(0, index).ToLower(); return(machineName == queueMachineName || queueMachineName == "localhost" || queueMachineName == "."); }
public void Test_PREFIX() { var expectedState = new CpuState(); expectedState.InstructionPrefix = true; var actualState = new CpuState(); var memoryMock = new Mock <IRandomAccessMemory>(); var instruction = new PREFIX(); instruction.Initialize(); //act while (!instruction.IsFetchNecessary()) { instruction.ExecuteCycle(actualState, memoryMock.Object); } TestHelper.AssertCpuState(expectedState, actualState); memoryMock.Verify(m => m.WriteByte(It.IsAny <ushort>(), It.IsAny <byte>()), Times.Never); }