Exemple #1
0
        public void ShouldDetermineIfParticleCrossesVerticalBorder()
        {
            // given
            var border = new Border(new Vector2D(0, 0), new Vector2D(0, 4));
            var start = new Vector2D(-3, -3);
            var end = new Vector2D(5, -5);

            // when
            var result = border.IsVectorCrossingBorder(start, end);

            // then
            Assert.That(result, Is.False);
        }
Exemple #2
0
        public void ShouldDetermineIfParticleCrossesWhenDiagonal()
        {
            // given
            var border = new Border(new Vector2D(200, 0), new Vector2D(350, 150));
            var leftPoint = new Vector2D(200, 10);
            var rightPoint = new Vector2D(400, 10);

            // when
            int leftSide = border.GetSide(leftPoint);
            int rightSide = border.GetSide(rightPoint);

            var result = border.IsVectorCrossingBorder(leftPoint, rightPoint);

            // then
            Assert.That(result, Is.False);
        }