public void Nr2char_should_return_the_ASCII_codepoint_for_the_integer() { var value1 = _callerUnderTest.Call(BuiltinFunctionCall.NewNr2char(32)); var value2 = _callerUnderTest.Call(BuiltinFunctionCall.NewNr2char(64)); Assert.Equal(VariableValue.NewString(" "), value1); Assert.Equal(VariableValue.NewString("@"), value2); }
public void Exists_should_return_1_for_variable_that_does_exist() { _variableMap["foo"] = VariableValue.NewString("bar"); var value = _callerUnderTest.Call(BuiltinFunctionCall.NewExists("foo")); Assert.Equal(VariableValue.NewNumber(1), value); }
public void Escape_should_escape_the_specified_characters_in_a_string_with_backslash() { var value = _callerUnderTest.Call(BuiltinFunctionCall.NewEscape(@"C:\Program Files", @" \")); Assert.Equal(VariableValue.NewString(@"C:\\Program\ Files"), value); }
public void Exists_should_return_0_for_variable_that_does_not_exist() { var value = _callerUnderTest.Call(BuiltinFunctionCall.NewExists("x")); Assert.Equal(VariableValue.NewNumber(0), value); }