using System; using System.Collections.Generic; using System.IO; using System.Web.Script.Serialization; namespace PhantomGladiator { static class UiStateTests { static void Check(bool ok, string what) { if (!ok) throw new Exception(what); Console.WriteLine("PASS " + what); } static string Refused(Action action) { try { action(); } catch (HostError error) { return error.Code; } return ""; } static int Main() { try { Run(); return 0; } catch (Exception error) { Console.WriteLine("FAIL " + error.Message); return 1; } } static void Run() { var file = Path.Combine(Paths.Data, "ui-state.json"); Check(!File.Exists(file) && UiState.LoadScript() == "window.__pgUiState=null;", "nothing saved yet hands the page null"); var state = new Dictionary { { "onboarded", "true" }, { "lang", "\"zh\"" }, { "note", "