Ejemplo n.º 1
0
        public void Three_Verticals()
        {
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(1, 3);
            TrackLayout.AddTrack(1, 4);
            TrackLayout.AddTrack(1, 5);

            TrackLayout.AddTrack(2, 2);
            TrackLayout.AddTrack(2, 3);
            TrackLayout.AddTrack(2, 4);

            TrackLayout.AddTrack(3, 3);

            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 3).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 4).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 5).Direction);

            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 2).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 3).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 4).Direction);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 3).Direction);
        }
Ejemplo n.º 2
0
        public void TwoCrosses()
        {
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(2, 2);
            TrackLayout.AddTrack(3, 2);
            TrackLayout.AddTrack(2, 1);

            TrackLayout.AddTrack(1, 4);
            TrackLayout.AddTrack(2, 4);
            TrackLayout.AddTrack(3, 4);
            TrackLayout.AddTrack(2, 5);

            TrackLayout.AddTrack(2, 3);

            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.Cross, TrackLayout.GetTrackAt(2, 2).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 3).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 2).Direction);

            Assert.Equal(TrackDirection.Cross, TrackLayout.GetTrackAt(2, 4).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 4).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 4).Direction);

            Assert.True(TrackLayout.GetTrackAt(2, 3).Happy);
        }
Ejemplo n.º 3
0
        public void Vertical()
        {
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(1, 2);

            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 2).Direction);
        }
Ejemplo n.º 4
0
        public void Horizontal()
        {
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(2, 1);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 1).Direction);
        }
Ejemplo n.º 5
0
        public void RightDown()
        {
            TrackLayout.AddTrack(2, 1);
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(1, 2);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.RightDown, TrackLayout.GetTrackAt(1, 1).Direction);
        }
Ejemplo n.º 6
0
        public void LeftUp()
        {
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(2, 1);
            TrackLayout.AddTrack(2, 2);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.LeftUp, TrackLayout.GetTrackAt(2, 2).Direction);
        }
Ejemplo n.º 7
0
        public void SidewaysHairpin()
        {
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(2, 2);
            TrackLayout.AddTrack(3, 2);
            TrackLayout.AddTrack(3, 1);
            TrackLayout.AddTrack(2, 1);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 2).Direction);
            Assert.Equal(TrackDirection.LeftUp, TrackLayout.GetTrackAt(3, 2).Direction);
            Assert.Equal(TrackDirection.LeftDown, TrackLayout.GetTrackAt(3, 1).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 1).Direction);
        }
Ejemplo n.º 8
0
        public void VerticalHairpin()
        {
            TrackLayout.AddTrack(1, 3);
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(2, 1);
            TrackLayout.AddTrack(2, 2);

            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 3).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.RightDown, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.LeftDown, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 2).Direction);
        }
Ejemplo n.º 9
0
        public void CrossMiddleLast()
        {
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(3, 2);
            TrackLayout.AddTrack(2, 1);
            TrackLayout.AddTrack(2, 3);
            TrackLayout.AddTrack(2, 2);

            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.Cross, TrackLayout.GetTrackAt(2, 2).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 3).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 2).Direction);
        }
Ejemplo n.º 10
0
        public void Happiness()
        {
            TrackLayout.AddTrack(1, 1);

            Assert.False(TrackLayout.GetTrackAt(1, 1).Happy);

            TrackLayout.AddTrack(1, 2);

            Assert.False(TrackLayout.GetTrackAt(1, 1).Happy);
            Assert.False(TrackLayout.GetTrackAt(1, 2).Happy);

            TrackLayout.AddTrack(1, 3);

            Assert.False(TrackLayout.GetTrackAt(1, 1).Happy);
            Assert.True(TrackLayout.GetTrackAt(1, 2).Happy);
            Assert.False(TrackLayout.GetTrackAt(1, 3).Happy);
        }
Ejemplo n.º 11
0
        public void LeftAngleWithCircleOnTop()
        {
            TrackLayout.AddTrack(1, 3);
            TrackLayout.AddTrack(2, 3);
            TrackLayout.AddTrack(2, 4);
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(2, 1);
            TrackLayout.AddTrack(2, 2);
            TrackLayout.AddTrack(1, 2);

            Assert.Equal(TrackDirection.RightUp, TrackLayout.GetTrackAt(1, 3).Direction);
            Assert.Equal(TrackDirection.LeftDown, TrackLayout.GetTrackAt(2, 3).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 4).Direction);
            Assert.Equal(TrackDirection.RightDown, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.LeftDown, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.LeftUp, TrackLayout.GetTrackAt(2, 2).Direction);
            Assert.Equal(TrackDirection.RightUpDown, TrackLayout.GetTrackAt(1, 2).Direction);
        }
Ejemplo n.º 12
0
        public void LeftRightUp_DrawOver()
        {
            TrackLayout.AddTrack(1, 3);
            TrackLayout.AddTrack(2, 3);
            TrackLayout.AddTrack(3, 3);
            TrackLayout.AddTrack(2, 2);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 3).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 3).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 3).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 2).Direction);

            TrackLayout.AddTrack(2, 3);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 3).Direction);
            Assert.Equal(TrackDirection.LeftRightUp, TrackLayout.GetTrackAt(2, 3).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 3).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 2).Direction);
        }
Ejemplo n.º 13
0
        public void Two_Verticals()
        {
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(1, 3);
            TrackLayout.AddTrack(1, 4);

            TrackLayout.AddTrack(2, 2);
            TrackLayout.AddTrack(2, 3);


            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 3).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 4).Direction);

            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 2).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 3).Direction);
        }
Ejemplo n.º 14
0
        public void LeftRightDown_DrawOver()
        {
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(2, 1);
            TrackLayout.AddTrack(3, 1);
            TrackLayout.AddTrack(2, 2);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 1).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 2).Direction);

            TrackLayout.AddTrack(2, 1);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.RightDown_LeftDown, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 1).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 2).Direction);
        }
Ejemplo n.º 15
0
        public void Trident()
        {
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(2, 2);
            TrackLayout.AddTrack(3, 2);
            TrackLayout.AddTrack(3, 1);
            TrackLayout.AddTrack(2, 3);
            TrackLayout.AddTrack(2, 2);

            TrackLayout.AddTrack(2, 1);

            Assert.Equal(TrackDirection.RightDown, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.RightUp, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.Cross, TrackLayout.GetTrackAt(2, 2).Direction);
            Assert.Equal(TrackDirection.LeftUp, TrackLayout.GetTrackAt(3, 2).Direction);
            Assert.Equal(TrackDirection.LeftDown, TrackLayout.GetTrackAt(3, 1).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(2, 3).Direction);

            Assert.Equal(TrackDirection.LeftRightDown, TrackLayout.GetTrackAt(2, 1).Direction);
        }
Ejemplo n.º 16
0
        public void FishHook()
        {
            TrackLayout.AddTrack(5, 2);
            TrackLayout.AddTrack(4, 2);
            TrackLayout.AddTrack(3, 2);
            TrackLayout.AddTrack(3, 3);
            TrackLayout.AddTrack(2, 3);
            TrackLayout.AddTrack(1, 3);
            TrackLayout.AddTrack(1, 2);
            TrackLayout.AddTrack(1, 1);
            TrackLayout.AddTrack(2, 1);
            TrackLayout.AddTrack(3, 1);

            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(5, 2).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(4, 2).Direction);
            Assert.Equal(TrackDirection.RightDown, TrackLayout.GetTrackAt(3, 2).Direction);
            Assert.Equal(TrackDirection.LeftUp, TrackLayout.GetTrackAt(3, 3).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 3).Direction);
            Assert.Equal(TrackDirection.RightUp, TrackLayout.GetTrackAt(1, 3).Direction);
            Assert.Equal(TrackDirection.Vertical, TrackLayout.GetTrackAt(1, 2).Direction);
            Assert.Equal(TrackDirection.RightDown, TrackLayout.GetTrackAt(1, 1).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(2, 1).Direction);
            Assert.Equal(TrackDirection.Horizontal, TrackLayout.GetTrackAt(3, 1).Direction);
        }