public void TestIsNumeric() { var c = StateMachineBuilder.ChoiceState() .Choice(StateMachineBuilder.Choice() .Transition(StateMachineBuilder.Next("NextState")) .Condition(StateMachineBuilder.IsNumeric("$.isNumeric", true))) .Choice(StateMachineBuilder.Choice() .Transition(StateMachineBuilder.Next("NextState")) .Condition(StateMachineBuilder.IsNumeric("$.isNumeric", false)) ) .Build(); var choices = c.Choices.ToArray(); Assert.False(choices[0].Condition.Match(JObject.FromObject(new { isNumeric = "str" }))); Assert.False(choices[0].Condition.Match(JObject.FromObject(new { isNumeric = DateTime.Now }))); Assert.True(choices[0].Condition.Match(JObject.FromObject(new { isNumeric = 33 }))); Assert.True(choices[0].Condition.Match(JObject.FromObject(new { isNumeric = 33.23 }))); Assert.True(choices[1].Condition.Match(JObject.FromObject(new { isNumeric = "str" }))); Assert.True(choices[1].Condition.Match(JObject.FromObject(new { isNumeric = DateTime.Now }))); Assert.False(choices[1].Condition.Match(JObject.FromObject(new { isNumeric = 33 }))); Assert.False(choices[1].Condition.Match(JObject.FromObject(new { isNumeric = 33.23 }))); }