public void TestAquire() { using (var context = new MainContext()) { var ret = context.Acquire(); Assert.That(ret, Is.True); var threadAquiredContext = false; Task.Run(() => { threadAquiredContext = context.Acquire(); }).Wait(); Assert.That(threadAquiredContext, Is.False); } Utility.AssertNoGLibLog(); }
public void TestIsOwner() { using (var context = new MainContext()) { Assert.That(context.IsOwner, Is.False); context.Acquire(); Assert.That(context.IsOwner, Is.True); } Utility.AssertNoGLibLog(); }
public void TestRelease() { using (var context = new MainContext()) { Assume.That(context.IsOwner, Is.False); var ret = context.Acquire(); Assume.That(ret, Is.True); Assume.That(context.IsOwner, Is.True); context.Release(); Assert.That(context.IsOwner, Is.False); } Utility.AssertNoGLibLog(); }