コード例 #1
0
        public void DotProduct_Tuple_InvalidOuter()
        {
            var a = new Dimension(1, 2);
            var b = new Tuple <int, int>(2, 0);

            Assert.ThrowsException <ArgumentOutOfRangeException>(() => a.Dot(b));
        }
コード例 #2
0
        public void DotProduct_Tuple_InvalidInner()
        {
            var a = new Dimension(1, 2);
            var b = new Tuple <int, int>(3, 4);

            Assert.ThrowsException <InvalidOperationException>(() => a.Dot(b));
        }
コード例 #3
0
        public void DotProduct_Tuple_OK()
        {
            var a = new Dimension(1, 2);
            var b = new Tuple <int, int>(2, 3);
            var d = a.Dot(b);

            Assert.IsFalse(d.IsEmpty, "The dimension should not be empty.");
            Assert.AreEqual(1, d.Rows, "Invalid value for rows.");
            Assert.AreEqual(3, d.Columns, "Invalid value for columns.");
        }