コード例 #1
0
ファイル: FunctionCallTests.cs プロジェクト: bg0jr/RaynMaker
        public void Invoke_TooLessArguments_Throws()
        {
            var function = new FunctionCall(typeof(FakeFunctions).GetMethod("Double"));

            var ex = Assert.Throws <InvalidOperationException>(() => function.Invoke());

            Assert.That(ex.Message, Does.Contain("parameter count mismatch"));
        }
コード例 #2
0
ファイル: FunctionCallTests.cs プロジェクト: bg0jr/RaynMaker
        public void Invoke_IntPassedDoubleExpected_InvokeSucceeds()
        {
            var function = new FunctionCall(typeof(FakeFunctions).GetMethod("Double"));

            function.AddArgument(21);

            var result = function.Invoke();

            Assert.That(result, Is.EqualTo(42));
        }
コード例 #3
0
ファイル: FunctionCallTests.cs プロジェクト: bg0jr/RaynMaker
        public void Invoke_DoublePassedIntExpected_InvokeSucceeds()
        {
            var function = new FunctionCall(typeof(FakeFunctions).GetMethod("Round"));

            function.AddArgument(21.21d);
            function.AddArgument(0d);

            var result = function.Invoke();

            Assert.That(result, Is.EqualTo(21));
        }