Пример #1
0
        public void TestFourthQuadrantFailure(float x, float y)
        {
            VectorRange range = new VectorRange(new Vector2(1, 1f), new Vector2(1, 0));

            Assume.That(!(x == 0 && y == 0));
            Assume.That((x >= 0 && y > 0 && y < x));
            Assert.False(range.Contains(new Vector2(x, y)));
        }
Пример #2
0
        public void TestThirdQuadrantFailure(float x, float y)
        {
            VectorRange range = new VectorRange(new Vector2(1, .1f), new Vector2(0, -1));

            Assume.That(!(x == 0 && y == 0));
            Assume.That((y <= 0 && x > 0) || (x >= 0 && y >= 0 && y < .1f * x));
            Assert.False(range.Contains(new Vector2(x, y)));
        }
Пример #3
0
        public void TestFourthQuadrantSuccess(float x, float y)
        {
            VectorRange range = new VectorRange(new Vector2(1, 1f), new Vector2(1, 0));

            Assume.That(!(x == 0 && y == 0));
            Assume.That((x <= 0) || (x >= 0 && y <= 0) || (x >= 0 && y >= 0 && y >= x));
            Assert.True(range.Contains(new Vector2(x, y)));
        }
Пример #4
0
        public void TestThirdQuadrantSuccess(float x, float y)
        {
            VectorRange range = new VectorRange(new Vector2(1, .1f), new Vector2(0, -1));

            Assume.That(!(x == 0 && y == 0));
            Assume.That((y >= 0 && x >= 0 && y >= .1f * x) || (x <= 0 && y >= 0) || (y <= 0 && x <= 0));
            Assert.True(range.Contains(new Vector2(x, y)));
        }
Пример #5
0
        public void TestSecondQuadrantFailure(float x, float y)
        {
            VectorRange range = new VectorRange(new Vector2(-1, 1), new Vector2(1, -1));

            Assume.That(!(x == 0 && y == 0));
            Assume.That((y <= 0 && x >= 0 && x > Mathf.Abs(y)) || (x >= 0 && y >= 0) || (x <= 0 && y >= 0 && y > Mathf.Abs(x)));
            Assert.False(range.Contains(new Vector2(x, y)));
        }
Пример #6
0
        public void TestSecondQuadrantSuccess(float x, float y)
        {
            VectorRange range = new VectorRange(new Vector2(-1, 1), new Vector2(1, -1));

            Assume.That(!(x == 0 && y == 0));
            Assume.That((y >= 0 && x <= 0 && y <= Mathf.Abs(x)) || (x <= 0 && y <= 0) || (x >= 0 && y <= 0 && x <= Mathf.Abs(y)));
            Assert.True(range.Contains(new Vector2(x, y)));
        }
Пример #7
0
        public void TestFirstQuadrantFailure(float x, float y)
        {
            VectorRange range = new VectorRange(Vector2.up, Vector2.left);

            Assume.That(!(x == 0 && y == 0));
            Assume.That((x > 0 && x <= _maxFloat) || (y < 0 && y >= _minFloat));
            Assert.False(range.Contains(new Vector2(x, y)));
        }
Пример #8
0
        public void TestFirstQuadrantSuccess(float x, float y)
        {
            VectorRange range = new VectorRange(Vector2.up, Vector2.left);

            Assume.That(!(x == 0 && y == 0));
            Assume.That(x <= 0 && x >= _minFloat && y >= 0 && y <= _maxFloat);
            Assert.True(range.Contains(new Vector2(x, y)));
        }