public CallContextUnitOfWorkStorage(bool useLogicalCallContext) { _instances = new SynchronizedStack <T>(useLogicalCallContext); }
public void TestSynchronizedStack() { SynchronizedStack<string> stack = new SynchronizedStack<string>(); stack.Push("one"); stack.Push("two"); Assert.IsTrue(stack.Count == 2); foreach (string name in stack) { Assert.IsTrue(stack.Contains(name)); } string peeked = stack.Peek(); Assert.AreEqual(peeked, stack.Pop()); Assert.IsTrue(stack.Count == 1); stack.Clear(); Assert.IsTrue(stack.Count == 0); }