public void ShouldCorrectlyUndo()
        {
            var history = new History();
            var element = new Ball() { X = 0, Y = 0 };
            var change = new TranslationChange(element, 5, 5);

            history.AddAndDo(change);
            history.Undo();

            Assert.IsFalse(history.CanUndo());
            Assert.IsTrue(history.CanRedo());

            Assert.AreEqual(0, element.X, 0.1);
            Assert.AreEqual(0, element.Y, 0.1);
        }
        public void ShouldRaiseEvents()
        {
            var eventsRaised = 0;
            var history = new History();
            var element = new Ball() { X = 0, Y = 0 };
            var change = new TranslationChange(element, 5, 5);

            // Bind closure expression
            history.Change += () =>
            {
                eventsRaised++;
            };

            // Act
            history.AddAndDo(change);
            history.Undo();
            history.Redo();

            Assert.AreEqual(3, eventsRaised);
        }