CookieMonster CreateLoggedInCookieMonster() { var monster = new CookieMonster(); monster.EatCookie("3"); // simulate MOTD monster.EatCookie("4"); // simulate MOTD end return(monster); }
public void CLIP_MOTD_END() { var monster = new CookieMonster(); monster.EatCookie("3"); var s = "4"; var cm = monster.EatCookie(s); Assert.Equal(FibsCookie.CLIP_MOTD_END, cm.Cookie); }
public void FIBS_MOTD1() { var monster = new CookieMonster(); monster.EatCookie("3"); var s = "+--------------------------------------------------------------------+"; var cm = monster.EatCookie(s); Assert.Equal(FibsCookie.FIBS_MOTD, cm.Cookie); Assert.Equal(s, cm.Raw); }
public void FIBS_MOTD2() { var monster = new CookieMonster(); monster.EatCookie("3"); var s = "| It was a dark and stormy night in Oakland. Outside, the rain |"; var cm = monster.EatCookie(s); Assert.Equal(FibsCookie.FIBS_MOTD, cm.Cookie); Assert.Equal(s, cm.Raw); }
public void CLIP_OWN_INFO() { var monster = new CookieMonster(); var s = "2 myself 1 1 0 0 0 0 1 1 2396 0 1 0 1 3457.85 0 0 0 0 0 Australia/Melbourne"; var cm = monster.EatCookie(s); Assert.Equal(FibsCookie.CLIP_OWN_INFO, cm.Cookie); Assert.Equal("myself", cm.Crumbs["name"]); Assert.True(CookieMonster.ParseBool(cm.Crumbs["allowpip"])); Assert.True(CookieMonster.ParseBool(cm.Crumbs["autoboard"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["autodouble"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["automove"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["away"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["bell"])); Assert.True(CookieMonster.ParseBool(cm.Crumbs["crawford"])); Assert.True(CookieMonster.ParseBool(cm.Crumbs["double"])); Assert.Equal(2396, int.Parse(cm.Crumbs["experience"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["greedy"])); Assert.True(CookieMonster.ParseBool(cm.Crumbs["moreboards"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["moves"])); Assert.True(CookieMonster.ParseBool(cm.Crumbs["notify"])); Assert.Equal(3457.85, double.Parse(cm.Crumbs["rating"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["ratings"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["ready"])); Assert.Equal("0", cm.Crumbs["redoubles"]); Assert.False(CookieMonster.ParseBool(cm.Crumbs["report"])); Assert.False(CookieMonster.ParseBool(cm.Crumbs["silent"])); Assert.Equal("Australia/Melbourne", cm.Crumbs["timezone"]); }
public void CLIP_MOTD_BEGIN() { var monster = new CookieMonster(); var s = "3"; var cm = monster.EatCookie(s); Assert.Equal(FibsCookie.CLIP_MOTD_BEGIN, cm.Cookie); }
public void FIBS_WARNINGAlreadyLoggedIn() { var monster = new CookieMonster(); var s = "** Warning: You are already logged in."; var cm = monster.EatCookie(s); Assert.Equal(FibsCookie.FIBS_WARNINGAlreadyLoggedIn, cm.Cookie); }
public void FIBS_PreLogin() { var monster = new CookieMonster(); var s = "Saturday, October 15 17:01:02 MEST ( Sat Oct 15 15:01:02 2016 UTC )"; var cm = monster.EatCookie(s); Assert.Equal(FibsCookie.FIBS_PreLogin, cm.Cookie); Assert.Equal(s, cm.Crumbs["message"]); }
public void CLIP_WELCOME() { var monster = new CookieMonster(); var s = "1 myself 1041253132 192.168.1.308"; var cm = monster.EatCookie(s); Assert.Equal(FibsCookie.CLIP_WELCOME, cm.Cookie); Assert.Equal("myself", cm.Crumbs["name"]); var lastLogin = CookieMonster.ParseTimestamp(cm.Crumbs["lastLogin"]); Assert.Equal(DateTime.Parse("12/30/2002 12:58:52 PM"), lastLogin); Assert.Equal("192.168.1.308", cm.Crumbs["lastHost"]); }