Exemplo n.º 1
0
        public void AutoResettingBoolean_NoIntervention_GetsInitialValue()
        {
            // Given
            const bool initialValue     = true;
            var        resettingBoolean = new AutoResettingBoolean(initialValue);

            // When / then
            for (int i = 0; i < 10; i++)
            {
                Assert.That(resettingBoolean.GetValue, Is.EqualTo(initialValue));
            }
        }
Exemplo n.º 2
0
        public void AutoResettingBoolean_WhenSet_ResetsToInitialValue()
        {
            // Given
            const bool initialValue     = true;
            var        resettingBoolean = new AutoResettingBoolean(initialValue);

            // When
            resettingBoolean.Set();
            bool first  = resettingBoolean.GetValue();
            bool second = resettingBoolean.GetValue();

            // Then
            Assert.That(first, Is.False);
            Assert.That(second, Is.True);
        }