Esempio n. 1
0
        public void ChartParse_Successful(
            string d, float constant,
            string song, string img, string bg,
            string name, string namer, string artist, string artistr,
            string bpm, string charter, string illust,
            string chartpath, string style
            )
        {
            (Chart actual, string json) = JsonHelper.GenerateChart(
                JsonUserInput.Past, d, constant, song, img, bg,
                name, namer, artist, artistr,
                bpm, charter, illust, chartpath, style
                );
            JObject jobj  = JObject.Parse(json);
            Chart   chart = JsonUserInput.ReadChartJson(jobj.CreateReader());

            Assert.That(
                actual.DifficultyGroup == chart.DifficultyGroup &&
                actual.Difficulty.Name == chart.Difficulty.Name &&
                actual.Difficulty.IsPlus == chart.Difficulty.IsPlus &&
                actual.SongPath == chart.SongPath &&
                actual.ImagePath == chart.ImagePath &&
                actual.Name == chart.Name &&
                actual.NameRomanized == chart.NameRomanized &&
                actual.Artist == chart.Artist &&
                actual.ArtistRomanized == chart.ArtistRomanized &&
                actual.Bpm == chart.Bpm &&
                actual.Constant == chart.Constant &&
                actual.Charter == chart.Charter &&
                actual.Illustrator == chart.Illustrator &&
                actual.Background == chart.Background &&
                actual.Style == chart.Style &&
                actual.ChartPath == chart.ChartPath
                , json + "\n" + JsonHelper.GetJson(chart));
        }
Esempio n. 2
0
 public void ChartParse_WithMissingValues_ThrowsError(
     string d, float constant,
     string song, string img, string bg,
     string name, string namer, string artist, string artistr,
     string bpm, string charter, string illust,
     string chartpath, string style
     )
 {
     (Chart actual, string json) = JsonHelper.GenerateChart(
         JsonUserInput.Future, d, constant, song, img, bg,
         name, namer, artist, artistr,
         bpm, charter, illust, chartpath, style
         );
     Assert.Throws <JsonReaderException>(() => {
         JObject jobj = JObject.Parse(json);
         Chart chart  = JsonUserInput.ReadChartJson(jobj.CreateReader());
     });
 }
Esempio n. 3
0
        public void ChartParse_WithCustomDifficulty_Success(string diff, string expectedChartPath)
        {
            DifficultyGroup dg = JsonUserInput.FromPreset(diff);

            Chart actual = getDummyChart();

            actual.DifficultyGroup = dg;
            actual.ChartPath       = expectedChartPath;
            string json = JsonHelper.GetJson(actual);

            JObject jobj  = JObject.Parse(json);
            Chart   chart = JsonUserInput.ReadChartJson(jobj.CreateReader());

            Assert.That(
                chart.DifficultyGroup == dg &&
                chart.ChartPath == expectedChartPath,
                json
                );
        }