@@ -627,6 +627,29 @@ public virtual void CallingOfFunctionWithManyParametersAndUnicodeStringResultIsC
627
627
Assert . Equal ( "Привет, Петя!" , output ) ;
628
628
}
629
629
630
+ [ Fact ]
631
+ public virtual void CallingOfFunctionWithNameContainingUnicodeCharactersIsCorrect ( )
632
+ {
633
+ // Arrange
634
+ const string functionCode = @"function сумма(число1, число2) {
635
+ var результат = число1 + число2;
636
+
637
+ return результат;
638
+ }" ;
639
+
640
+ // Act
641
+ int output ;
642
+
643
+ using ( var jsEngine = CreateJsEngine ( ) )
644
+ {
645
+ jsEngine . Execute ( functionCode ) ;
646
+ output = jsEngine . CallFunction < int > ( "сумма" , 678 , 711 ) ;
647
+ }
648
+
649
+ // Assert
650
+ Assert . Equal ( 1389 , output ) ;
651
+ }
652
+
630
653
#endregion
631
654
632
655
#region Getting, setting and removing variables
@@ -905,6 +928,30 @@ public virtual void RemovingVariableIsCorrect()
905
928
Assert . False ( variableAfterRemovingExists ) ;
906
929
}
907
930
931
+ [ Fact ]
932
+ public virtual void RemovingVariableWithNameContainingUnicodeCharactersIsCorrect ( )
933
+ {
934
+ // Arrange
935
+ const string variableName = "цена" ;
936
+ const double input = 6780.00 ;
937
+
938
+ // Act
939
+ bool variableBeforeRemovingExists ;
940
+ bool variableAfterRemovingExists ;
941
+
942
+ using ( var jsEngine = CreateJsEngine ( ) )
943
+ {
944
+ jsEngine . SetVariableValue ( variableName , input ) ;
945
+ variableBeforeRemovingExists = jsEngine . HasVariable ( variableName ) ;
946
+ jsEngine . RemoveVariable ( variableName ) ;
947
+ variableAfterRemovingExists = jsEngine . HasVariable ( variableName ) ;
948
+ }
949
+
950
+ // Assert
951
+ Assert . True ( variableBeforeRemovingExists ) ;
952
+ Assert . False ( variableAfterRemovingExists ) ;
953
+ }
954
+
908
955
#endregion
909
956
910
957
#region Script interruption
0 commit comments