public void NoModuleTest() { var module = new Abs(); var source = module.SourceModules[0]; Assert.Null(source); }
public void AbsTest(double data) { var source = new Constant { ConstantValue = data }; var module = new Abs { Source0 = source }; Assert.Equal(Math.Abs(source.GetValue(0, 0, 0)), module.GetValue(0, 0, 0)); }
public void SourceIndexOutOfRangeTest() { var module = new Abs(); #pragma warning disable CS0251 // Indexing an array with a negative index Assert.Throws<IndexOutOfRangeException>(() => module.SourceModules[-1]); #pragma warning restore CS0251 // Indexing an array with a negative index Assert.Throws<IndexOutOfRangeException>(() => module.SourceModules[module.SourceModuleCount]); Assert.Throws<IndexOutOfRangeException>(() => module.SourceModules[module.SourceModuleCount + 2]); }