public void NotifyCollectionChangedEventArgsConstructor9Test()
        {
            IList changed  = new List <object> ();
            int   newIndex = 2;
            int   oldIndex = 5;

            // Trying with Replace
            NotifyCollectionChangedEventArgs args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, changed, newIndex, oldIndex);

            CollectionChangedEventValidators.ValidateMoveOperation(args, changed, newIndex, oldIndex, "#I01");

            // Add some items to test this one.
            changed.Add(new object());
            changed.Add(new object());
            changed.Add(new object());

            // Trying with Replace again
            args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, changed, newIndex, oldIndex);

            CollectionChangedEventValidators.ValidateMoveOperation(args, changed, newIndex, oldIndex, "#I02");

            // Trying with newIndex < 0.
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, changed, -5, oldIndex);
                Assert.Fail("The index argument cannot be less than 0.");
            } catch (ArgumentException) {
            }

            // Trying with Reset
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, changed, newIndex, oldIndex);
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Reset.");
            } catch (ArgumentException) {
            }

            // Trying with Replace
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, changed, newIndex, oldIndex);
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Replace.");
            } catch (ArgumentException) {
            }

            // Trying with Add
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, changed, newIndex, oldIndex);
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Add.");
            } catch (ArgumentException) {
            }

            // Trying with Remove
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, changed, newIndex, oldIndex);
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Remove.");
            } catch (ArgumentException) {
            }
        }
        public void NotifyCollectionChangedEventArgsConstructor10Test()
        {
            object changed  = new object();
            int    newIndex = 2;
            int    oldIndex = 5;

            // Trying with Replace
            NotifyCollectionChangedEventArgs args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, changed, newIndex, oldIndex);

            CollectionChangedEventValidators.ValidateMoveOperation(args, new object [] { changed }, newIndex, oldIndex, "#J01");

            // Trying with newIndex < 0.
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, changed, -5, oldIndex);
                Assert.Fail("The newIndex argument cannot be less than 0.");
            } catch (ArgumentException) {
            }

            // Trying with Reset
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, changed, newIndex, oldIndex);
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Reset.");
            } catch (ArgumentException) {
            }

            // Trying with Replace
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, changed, newIndex, oldIndex);
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Replace.");
            } catch (ArgumentException) {
            }

            // Trying with Add
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, changed, newIndex, oldIndex);
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Add.");
            } catch (ArgumentException) {
            }

            // Trying with Remove
            try {
                args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, changed, newIndex, oldIndex);
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Remove.");
            } catch (ArgumentException) {
            }
        }
        public void NotifyCollectionChangedEventArgsConstructor10Test()
        {
            var       changed  = new object();
            const int NewIndex = 2;
            const int OldIndex = 5;

            // Trying with Replace
            var args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, changed, NewIndex, OldIndex);

            CollectionChangedEventValidators.ValidateMoveOperation(args, new[] { changed }, NewIndex, OldIndex, "#J01");

            // Trying with newIndex < 0.
            try
            {
                GC.KeepAlive(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move, changed, -5, OldIndex));
                Assert.Fail("The newIndex argument cannot be less than 0.");
            }
            catch (ArgumentException ex)
            {
                GC.KeepAlive(ex);
            }

            // Trying with Reset
            try
            {
                GC.KeepAlive(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, changed, NewIndex, OldIndex));
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Reset.");
            }
            catch (ArgumentException ex)
            {
                GC.KeepAlive(ex);
            }

            // Trying with Replace
            try
            {
                GC.KeepAlive(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, changed, NewIndex, OldIndex));
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Replace.");
            }
            catch (ArgumentException ex)
            {
                GC.KeepAlive(ex);
            }

            // Trying with Add
            try
            {
                GC.KeepAlive(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, changed, NewIndex, OldIndex));
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Add.");
            }
            catch (ArgumentException ex)
            {
                GC.KeepAlive(ex);
            }

            // Trying with Remove
            try
            {
                GC.KeepAlive(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, changed, NewIndex, OldIndex));
                Assert.Fail("Should not be able to call .ctor with NotifyCollectionChangedAction.Remove.");
            }
            catch (ArgumentException ex)
            {
                GC.KeepAlive(ex);
            }
        }