public void can_get_all_tokens_from_a_string() { var pp = new PP(); pp.Tokens("Hi $foo$ pers$on$").ShouldEqual(new List <string> { "foo", "on" }); pp.Tokens("Hi $foo$pers$on$").ShouldEqual(new List <string> { "foo", "on" }); pp.Tokens("Hi $foo$pers$on $").ShouldEqual(new List <string> { "foo" }); pp.Tokens("$Hi $foo$pers$on $").ShouldEqual(new List <string> { "foo" }); pp.Tokens("$Hi$foo$pers$on $").ShouldEqual(new List <string> { "Hi", "pers" }); pp.Tokens("$Hi$$foo$$pers$on$").ShouldEqual(new List <string> { "Hi", "foo", "pers" }); pp.Tokens("$Hi$$foo$$pers$$on$").ShouldEqual(new List <string> { "Hi", "foo", "pers", "on" }); }