Exemple #1
0
        public async void WriteFile_HasOneUiRow()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            var uiRowCount = rows.Count(r => r.Name.Equals("ui"));

            Assert.Equal(1, uiRowCount);
        }
Exemple #2
0
        public async void WriteFile_ScoreCodeRowsHaveNoTrueId()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            var scrcodeRowsWithTrueId = rows.Count(r => r.Name.Equals("scrcode") &&
                                                   r.CompetitorOrScoringSystemId.HasValue);

            Assert.Equal(0, scrcodeRowsWithTrueId);
        }
Exemple #3
0
        public async void WriteFile_scrfollowchampIs1or0()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            var rowToCheck = rows.First(r => r.Name.Equals("scrfollowchamp"));

            Assert.True(rowToCheck.Value.Equals("1", StringComparison.InvariantCultureIgnoreCase) ||
                        rowToCheck.Value.Equals("0", StringComparison.InvariantCultureIgnoreCase));
        }
Exemple #4
0
        public async void WriteFile_AllScoreRowsHaveSameScoringSystemId()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            Assert.Single(rows.Where(r => r.Name.StartsWith("scr") &&
                                     r.CompetitorOrScoringSystemId.HasValue)
                          .Select(r => r.CompetitorOrScoringSystemId)
                          .Distinct());
        }
Exemple #5
0
        public async void WriteFile_scrtiefinalsIsYesOrNo()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            var rowToCheck = rows.First(r => r.Name.Equals("scrtiefinals"));

            Assert.True(rowToCheck.Value.Equals("Yes", StringComparison.InvariantCultureIgnoreCase) ||
                        rowToCheck.Value.Equals("No", StringComparison.InvariantCultureIgnoreCase));
        }
Exemple #6
0
        public async void WriteFile_HasTwoRaces()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            Assert.Equal(2, rows.Where(r => r.Name.StartsWith("race") &&
                                       r.RaceId.HasValue)
                         .Select(r => r.RaceId)
                         .Distinct()
                         .Count());
        }
Exemple #7
0
        public async void WriteFile_HasCompetitorRowsWithTwoIds()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            Assert.Equal(2, rows.Where(r => r.Name.StartsWith("comp") &&
                                       r.CompetitorOrScoringSystemId.HasValue)
                         .Select(r => r.CompetitorOrScoringSystemId)
                         .Distinct()
                         .Count());
        }
Exemple #8
0
        public async void WriteFile_HasScoreCodeRowsWithId()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            var scrcodeRow        = rows.Count(r => r.Name.Equals("scrcode"));
            var scrcodeRowsWithId = rows.Count(r => r.Name.Equals("scrcode") &&
                                               r.Value.Contains("|5|"));

            Assert.True(scrcodeRow > 2);
            Assert.Equal(scrcodeRow, scrcodeRowsWithId);
        }
Exemple #9
0
        public async void WriteFile_HasRaceResultRowsForAllCompetitorsInAllRaces()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            Assert.Equal(4, rows.Where(r => r.CompetitorOrScoringSystemId.HasValue &&
                                       r.RaceId.HasValue)
                         .Select(r => new
            {
                r.RaceId,
                r.CompetitorOrScoringSystemId
            })
                         .Distinct()
                         .Count());
        }
Exemple #10
0
        public async void WriteFile_HasScoreRows()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            Assert.True(rows.Count(r => r.Name.StartsWith("scr")) > 20);
        }
Exemple #11
0
        public async void WriteFile_GetsLotsOfDetails()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            Assert.True(rows.Count(r => r.Name.StartsWith("ser")) > 20);
        }
Exemple #12
0
        public async void BasicWriteFile()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            Assert.True(rows.Count() > 10);
        }
Exemple #13
0
        public async void WriteFile_HasLotsOfColumnRows()
        {
            var rows = await SeriesWriter.WriteSeries(_series);

            Assert.True(rows.Count(r => r.Name == "column") > 100);
        }