public void GivenEnumProperty_WhenCheckValue_ShouldBeTrue()
        {
            _objectToCheck.EnumStateTest = State.Run;

            var testee = new PropertyEqualityCondition(_objectToCheck, "EnumStateTest", State.Run);

            testee.IsTrue().Should().BeTrue();
        }
        public void GivenEnumProperty_GivenDifferentValue_WhenCheckValueAsString_ShouldBeFalse()
        {
            _objectToCheck.EnumStateTest = State.Run;

            var testee = new PropertyEqualityCondition(_objectToCheck, "EnumStateTest", "Off");

            testee.IsTrue().Should().BeFalse();
        }
        public void WhenCheckPrivateProperty_ShouldBeTrue()
        {
            _objectToCheck.SetPrivateInt(7);

            var testee = new PropertyEqualityCondition(_objectToCheck, "PrivateIntTest", 7);

            testee.IsTrue().Should().BeTrue();
        }
        public void MustSupportEmptyString()
        {
            _objectToCheck.PropertyTest = "";
            var testee = new PropertyEqualityCondition(_objectToCheck, "PropertyTest", "");

            Action action = () => testee.IsTrue();

            action.ShouldNotThrow();
        }
        public void WhenApplyConditionToDerivedClass_ShouldNotThrow()
        {
            var derived = new DerivedTest();

            derived.PropertyIntTest = 1;
            var testee = new PropertyEqualityCondition(derived, "PropertyIntTest", 1);

            Action action = () => testee.IsTrue();

            action.ShouldNotThrow();
        }
        public void WhenApplyConditionToDerivedClassWithProtectedVirtualReadonlyProperty_ShouldNotThrow()
        {
            var derived = new DerivedTest();
            var testee  = new PropertyEqualityCondition(derived, "AbstractProtectedPropertyTest", 99);

            derived.SetTestValue(99);

            Action action = () => testee.IsTrue();

            action.ShouldNotThrow();
            testee.IsTrue().Should().BeTrue();

            derived.SetTestValue(10);
            testee.IsTrue().Should().BeFalse();
        }
 public void SetUp()
 {
     _objectToCheck = new Test();
     _testee        = new PropertyEqualityCondition(_objectToCheck, "PropertyTest", "hello");
 }