File tree Expand file tree Collapse file tree
src/Tests/OneScript.Core.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -889,7 +889,6 @@ public void Can_Call_Member_ProceduresWithBslProcess(string code)
889889 var method = block . CreateDelegate < Func < TestContextClass , BslValue > > ( ) ;
890890 var testValue = new TestContextClass ( ) ;
891891 method ( testValue ) ;
892-
893892 }
894893
895894 [ Theory ]
@@ -913,7 +912,26 @@ public void Can_Call_Member_FunctionsWithBslProcess(string code)
913912 var method = block . CreateDelegate < Func < TestContextClass , BslValue > > ( ) ;
914913 var testValue = new TestContextClass ( ) ;
915914 method ( testValue ) ;
915+ }
916+
917+ [ Theory ]
918+ [ InlineData ( "Объект.Процедура0СПроцессом(1)" ) ]
919+ [ InlineData ( "Объект.Функция0СПроцессом(1)" ) ]
920+ [ InlineData ( "Объект.Функция1СУмолчаниемСПроцессом(1, 2)" ) ]
921+ [ InlineData ( "Объект.Процедура1СУмолчаниемСПроцессом(1, 2, 3);" ) ]
922+ public void Cannot_Call_Member_Procedures_With_Wrong_Argument_Count ( string code )
923+ {
924+ var tm = new DefaultTypeManager ( ) ;
925+ var testType = tm . RegisterClass ( typeof ( TestContextClass ) ) ;
926+
927+ var block = new CompiledBlock ( default ) ;
928+ block . Parameters . Insert ( "Объект" , new BslTypeValue ( testType ) ) ;
929+ block . CodeBlock = code ;
916930
931+ var runtimeException = Assert . ThrowsAny < RuntimeException > ( ( ) => {
932+ var method = block . CreateDelegate < Func < TestContextClass , BslValue > > ( ) ;
933+ } ) ;
934+ Assert . Contains ( "Слишком много фактических параметров" , runtimeException . Message ) ;
917935 }
918936
919937 [ Fact ]
You can’t perform that action at this time.
0 commit comments