Exemplo n.º 1
0
            public void Builder_Without_Path_Should_Throw_IndexOutOfRangeException()
            {
                var model       = new Builder();
                var pathHistory = new PathHistory(model);

                Assert.Throws <IndexOutOfRangeException>(() => pathHistory.Last());
            }
Exemplo n.º 2
0
            public void HasBegun_Should_Be_False_With_Fresh_Builder()
            {
                var builder     = new Builder();
                var pathHistory = new PathHistory(builder);

                Assert.That(pathHistory.HasBegun, Is.False);
            }
Exemplo n.º 3
0
            public void IsEnd_Should_Be_True_With_Fresh_Builder()
            {
                var builder     = new Builder();
                var pathHistory = new PathHistory(builder);

                Assert.That(pathHistory.IsEnded, Is.True);
            }
Exemplo n.º 4
0
            public void Builder_With_One_Step_Should_Return_The_First_Step()
            {
                var model       = new Builder();
                var pathHistory = new PathHistory(model);

                model.Path.Increase(new Pillar(3, 10));

                var actual = pathHistory.GetOld();

                Assert.That(actual.X, Is.EqualTo(3), "pillar.X");
                Assert.That(actual.Y, Is.EqualTo(10), "pillar.Y");
            }
        private void OnForwardButtonClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (this.transitionManager1.IsTransition)
            {
                return;
            }
            int currentIndex = PathHistory.IndexOf(CurrentNode);

            if (currentIndex >= PathHistory.Count - 1)
            {
                return;
            }
            var activeNode = PathHistory[currentIndex + 1];

            RunZoomInAnimation(activeNode, () => { GoForward(); });
        }
Exemplo n.º 6
0
            public void Builder_With_Multiple_Steps_Should_Return_The_Last_One()
            {
                var model       = new Builder();
                var pathHistory = new PathHistory(model);

                model.Path.Increase(new Pillar(0, 0));
                model.Path.Increase(new Pillar(2, 1));
                model.Path.Increase(new Pillar(4, 2));
                model.Path.Increase(new Pillar(6, 3));
                model.Path.Increase(new Pillar(8, 4));

                var actual = pathHistory.Last();

                Assert.That(actual.X, Is.EqualTo(8), "pillar.X");
                Assert.That(actual.Y, Is.EqualTo(4), "pillar.Y");
            }
Exemplo n.º 7
0
            public void Builder_With_Multiple_Steps(int skipOldStepCount)
            {
                var model       = new Builder();
                var pathHistory = new PathHistory(model);

                model.Path.Increase(new Pillar(0, 0));
                model.Path.Increase(new Pillar(2, 1));
                model.Path.Increase(new Pillar(4, 2));
                model.Path.Increase(new Pillar(6, 3));
                model.Path.Increase(new Pillar(8, 4));

                for (int i = 0; i < skipOldStepCount; i++)
                {
                    pathHistory.GetOld();
                }

                var actual = pathHistory.GetOld();

                Assert.That(actual.X, Is.EqualTo(skipOldStepCount * 2), "pillar.X");
                Assert.That(actual.Y, Is.EqualTo(skipOldStepCount), "pillar.Y");
            }