Пример #1
0
            public void negative_dimension_throws()
            {
                var v = new Vector4D();

                Assert.Throws <ArgumentOutOfRangeException>(() => v.Get(-1));
                Assert.Throws <ArgumentOutOfRangeException>(() => v.Get(int.MinValue));
            }
Пример #2
0
            public void large_dimension_throws()
            {
                var v = new Vector4D();

                Assert.Throws <ArgumentOutOfRangeException>(() => v.Get(4));
                Assert.Throws <ArgumentOutOfRangeException>(() => v.Get(int.MaxValue));
            }
Пример #3
0
            public void can_get_all_componenets()
            {
                var v = new Vector4D(-1.0, 5.0, -0.5, 0.1);

                Assert.Equal(-1.0, v.Get(0));
                Assert.Equal(5.0, v.Get(1));
                Assert.Equal(-0.5, v.Get(2));
                Assert.Equal(0.1, v.Get(3));
            }
Пример #4
0
            public void can_set_all_componenets()
            {
                var v = new Vector4D(1, 2, 3, 4);

                v.Set(0, -1.0);
                v.Set(1, 5.0);
                v.Set(2, -0.5);
                v.Set(3, 0.1);

                Assert.Equal(-1.0, v.Get(0));
                Assert.Equal(5.0, v.Get(1));
                Assert.Equal(-0.5, v.Get(2));
                Assert.Equal(0.1, v.Get(3));
            }