Exemplo n.º 1
0
        public void GetChanges_ienumerable_generic_withIgnored()
        {
            var oldState = new IEnumerableGenericVictim
            {
                IEnumerableGeneric = new List <int> {
                    11, 22
                }
            };

            var newState = new IEnumerableGenericVictim
            {
                IEnumerableGeneric = new List <int> {
                    33, 44
                }
            };

            worker.FindDifferences
            (
                oldState,
                newState,
                stateChanges,
                5,
                (field, context) => false,
                (prop, context) => context.BreadcrumbAsString.Equals("IEnumerableGeneric[0]")
            );

            Assert.Single(stateChanges.Changes);
            Assert.Equal(22, stateChanges.Changes[0].OldValue);
            Assert.Equal(44, stateChanges.Changes[0].NewValue);
        }
Exemplo n.º 2
0
        public void GetChanges_ienumerable_generic()
        {
            var oldState = new IEnumerableGenericVictim
            {
                IEnumerableGeneric = new List <int> {
                    11, 22
                }
            };

            var newState = new IEnumerableGenericVictim
            {
                IEnumerableGeneric = new List <int> {
                    33, 44
                }
            };

            worker.FindDifferences(oldState, newState, stateChanges, 5);

            Assert.Equal(2, stateChanges.Changes.Count);
        }