示例#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);
        }
示例#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();
        }
        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();
        }