Exemplo n.º 1
0
        public void ChangeAll()
        {
            Modify
            .This(something)
            .ChangeAll();

            var changed = 0;

            if (something.MyProperty != -42)
            {
                changed++;
            }

            if (something.MyOtherProperty != -42)
            {
                changed++;
            }

            if (something.AnotherProperty != -42)
            {
                changed++;
            }

            if (something.YetAnotherProperty != -42)
            {
                changed++;
            }

            Assert.Equal(4, changed);
        }
Exemplo n.º 2
0
        public void Change()
        {
            Modify
            .This(something)
            .Change(s => s.MyProperty);

            Assert.NotEqual(-42, something.MyProperty);
            Assert.Equal(-42, something.MyOtherProperty);
            Assert.Equal(-42, something.AnotherProperty);
            Assert.Equal(-42, something.YetAnotherProperty);
        }
Exemplo n.º 3
0
        public void ChangeReallyMeansChange()
        {
            var something = Generate.One <WithBoolProperty>();

            10.Times(
                () =>
            {
                var before = something.MyPropery;
                Modify.This(something).Change(e => e.MyPropery);
                Assert.NotEqual(before, something.MyPropery);
            }
                );
        }