Exemple #1
0
        public void Init()
        {
            RepositoryMock = new Mock <IResourceLockRepository>();
            Lock           = LockItem.CreateRead("xxx", null);

            //add both read and write locks as secondary ones
            SecondaryLocks = new List <LockItem>();
            for (int i = 0; i < 10; i++)
            {
                var item = i % 2 == 0 ? LockItem.CreateRead(i.ToString(), null) : LockItem.CreateWrite(i.ToString(), null);
                SecondaryLocks.Add(item);
            }
        }
 public void Init()
 {
     Lock           = LockItem.CreateRead("xxx", null);
     RepositoryMock = new Mock <IResourceLockRepository>();
     Guard          = new ResourceLockGuard(Lock, Repository);
 }