Пример #1
0
        public static void NegateTwiceReturnsOriginal()
        {
            var fake = new Fake {
                IsTrueOrNull = false
            };

            using var condition        = new Condition(fake.ObservePropertyChanged(x => x.IsTrueOrNull), () => fake.IsTrueOrNull);
            using var negatedCondition = new Negated <Condition>(condition);
#pragma warning disable CS0618 // Type or member is obsolete
            using var negatedTwice = negatedCondition.Negate();
#pragma warning restore CS0618 // Type or member is obsolete
            Assert.AreSame(condition, negatedTwice);
        }
Пример #2
0
        public void NegateTwiceReturnsOriginal()
        {
            var fake = new Fake {
                IsTrueOrNull = false
            };

            using (var condition = new Condition(fake.ObservePropertyChanged(x => x.IsTrueOrNull), () => fake.IsTrueOrNull))
            {
                using (var negatedCondition = new Negated <Condition>(condition))
                {
#pragma warning disable 618
                    using (var negatedTwice = negatedCondition.Negate())
#pragma warning restore 618
                    {
                        Assert.AreSame(condition, negatedTwice);
                    }
                }
            }
        }