public void ClassArgument() { var person = new ClassTests.Person(MondValue.Object(), "Rohan"); var personValue = MondValue.Object(_state); personValue.UserData = person; _state["rohan"] = personValue; Assert.True(_state.Run(@" return global.Greet(global.rohan); ") == "hello Rohan!"); personValue.UserData = "something"; Assert.Throws <MondRuntimeException>(() => _state.Run(@" global.Greet(global.rohan); ")); personValue.UserData = null; Assert.Throws <MondRuntimeException>(() => _state.Run(@" global.Greet(global.rohan); ")); }
public static string Greet(ClassTests.Person person) { return(person.GenerateGreeting()); }