Ejemplo n.º 1
0
        public void GetChanges_SameInstance_noChanges()
        {
            var oldState = new BasicVictim {
                MyString = "yay"
            };

            var actual = stateChangeFinder.GetChanges(oldState, oldState, fieldIgnoreFn, propertyIgnoreFn);

            Assert.Empty(actual.Changes);
        }
Ejemplo n.º 2
0
        public void GetChanges_worksWith_old_null_byCalling_worker()
        {
            var oldState = new BasicVictim {
                MyString = "yay"
            };

            stateChangeFinder.MaxDepth = 666;
            var actual = stateChangeFinder.GetChanges(oldState, null, fieldIgnoreFn, propertyIgnoreFn);

            A.CallTo(() => worker.FindDifferences(oldState, null, actual, 666, fieldIgnoreFn, propertyIgnoreFn)).MustHaveHappenedOnceExactly();
        }
Ejemplo n.º 3
0
        public void GetChanges_worksWith_null_new_byCalling_worker()
        {
            var newState = new BasicVictim {
                MyString = "yay"
            };

            stateChangeFinder.MaxDepth = 666;
            var actual = stateChangeFinder.GetChanges(null, newState);

            A.CallTo(() => worker.FindDifferences(null, newState, actual, 666)).MustHaveHappenedOnceExactly();
        }