示例#1
0
 public void Setup()
 {
     _lockManager    = new MutextLockManager(Moq.Mock.Of <ILogger>());
     _lockKey        = Guid.NewGuid().ToString();
     _dummyGetOutput = "GetOutput";
     _get            = () => { return(_dummyGetOutput); };
     _actualOutput   = null;
 }
示例#2
0
            public void Given_Lock_Is_Already_Held_By_Other_Process()
            {
                _lockManager = new MutextLockManager(Moq.Mock.Of <ILogger>());

                var t = new Thread(new ThreadStart(() =>
                {
                    _otherMutex = new Mutex(false, "Global\\" + _lockKey);
                    _otherMutex.WaitOne();
                    Thread.Sleep(3000);
                    _otherMutex.ReleaseMutex();
                }));

                t.Start();
            }
示例#3
0
 public void Setup()
 {
     _lockManager = new MutextLockManager(Moq.Mock.Of <ILogger>());
     _lockKey     = Guid.NewGuid().ToString();
 }