示例#1
0
        public void LevelParse_NoCharts_ThrowsError()
        {
            (Level actual, string json) = JsonHelper.GenerateLevel("testpack", new Chart[0]);

            Assert.Throws <JsonReaderException>(() => {
                JObject jobj = JObject.Parse(json);
                Level level  = JsonUserInput.ReadLevelJson(jobj.CreateReader());
            });
        }
示例#2
0
        public void LevelParse_NoPacks_Success()
        {
            (Level actual, string json) = JsonHelper.GenerateLevel(null, new Chart[] { getDummyChart() });

            JObject jobj  = JObject.Parse(json);
            Level   level = JsonUserInput.ReadLevelJson(jobj.CreateReader());

            Assert.IsNull(level.PackExternalId);
        }
示例#3
0
        public void LevelParse_Success(int chartCount)
        {
            Chart[] charts = new Chart[chartCount];
            for (int i = 0; i < chartCount; i++)
            {
                charts[i] = getDummyChart();
            }

            (Level actual, string json) = JsonHelper.GenerateLevel("testpack", charts);
            JObject jobj  = JObject.Parse(json);
            Level   level = JsonUserInput.ReadLevelJson(jobj.CreateReader());

            Assert.That(
                level.PackExternalId == "testpack" && level.Charts.Length == chartCount,
                json
                );
        }