From 950673cb0acc8ca313879b8dbf0087b11b6d2bc5 Mon Sep 17 00:00:00 2001 From: Dmytro Kyshchenko Date: Fri, 16 Feb 2018 18:33:16 +0200 Subject: [PATCH] #190 - Tests --- .../TypeAnalyzerTests/MatrixTests.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/xFunc.Tests/Analyzers/TypeAnalyzerTests/MatrixTests.cs b/xFunc.Tests/Analyzers/TypeAnalyzerTests/MatrixTests.cs index 952d467a2..ba9f5d63e 100644 --- a/xFunc.Tests/Analyzers/TypeAnalyzerTests/MatrixTests.cs +++ b/xFunc.Tests/Analyzers/TypeAnalyzerTests/MatrixTests.cs @@ -57,6 +57,42 @@ public void TestMatrixVector() Test(exp, ResultType.Matrix); } + [Fact] + public void TestMatrixUndefinedElement() + { + var exp = new Matrix(new Vector[] { new Vector(new[] { new Variable("x") }) }); + + Test(exp, ResultType.Undefined); + } + + [Fact] + public void TestMatrixNotVectorElement() + { + DifferentParametersExpression exp = new Matrix(2, 2) + { + Arguments = new[] { new Number(2) } + }; + + TestDiffParamException(exp); + } + + [Fact] + public void TestEmptyMatrix() + { + var exp = new Matrix(0, 0); + + Test(exp, ResultType.Matrix); + } + + [Fact] + public void TestNullMatrix() + { + var exp = new Matrix(0, 0); + exp.Arguments = null; + + Test(exp, ResultType.Matrix); + } + [Fact] public void TestDetermenantUndefined() {