Exemplo n.º 1
0
        public void TestWasFalse()
        {
            var boolean = new AtomicBool();

            if (boolean.WasFalse())
            {
                if (boolean.WasFalse())
                {
                    Assert.Fail("AtomicBool should be true until SetFalse is called");
                }

                boolean.SetFalse();

                if (boolean.WasFalse())
                {
                    Assert.Pass();
                }
                else
                {
                    Assert.Fail("AtomicBool should be reset by calling SetFalse");
                }
            }
            else
            {
                Assert.Fail("AtomicBool should be false when initialized");
            }
        }