<commit_before>﻿using System.Collections.Generic;
using NUnit.Framework;
using Rutracker.Anime.Models;
using Rutracker.Anime.Parser;
using Rutracker.Anime.Parser.Tokenizers;

namespace Rutracker.Anime.Tests
{
    [TestFixture(Category = "slow", Ignore = false)]
    public class MainTests
    {
        private readonly TitleParser _titleParser = new TitleParser(PartTypeResolver.Default, new PartParsers {
            SeriesTokenizer = new SeriesTokenizer(),
            TracksTokenizer = new TracksTokenizer(),
            TraitsTokenizer = new TraitsTokenizer(),
            TypesTokenizer = new TypesTokenizer()
        });

        [Test, TestCaseSource("MainTestCases")]
        public void MainTest(string title, Models.Anime expected) {
            var actual = _titleParser.Parse(title);

            Assert.AreEqual(expected, actual);
        }

        private static IEnumerable<TestCaseData> MainTestCases {
            get {
                yield return new TestCaseData(
                    "Трусливый Велосипедист / Yowamushi Pedal (Набэсима Осаму) [TV] [01-09 из 12] [Без хардсаба] [RUS(int), JAP+SUB] [2013 г., спорт, HDTVRip] [720p]",
                    new Models.Anime {
                        Names = new[] { "<NAME>", "<NAME>" },
                        Types = new[] {Models.Anime.Type.TV },
                        Series = new Series(1, 9, 12),
                        Tracks = new[] { "RUS(int)", "JAP+SUB" },
                        Traits = new Traits(2013, new[] { "спорт" }, "HDTVRip")
                    });
            }
        }
    }<commit_msg>several test cases were added for TitleParser<commit_after>﻿using System.Collections.Generic;
using NUnit.Framework;
using Rutracker.Anime.Models;
using Rutracker.Anime.Parser;
using Rutracker.Anime.Parser.Tokenizers;

namespace Rutracker.Anime.Tests
{
    [TestFixture(Category = "slow", Ignore = false)]
    public class MainTests
    {
        private readonly TitleParser _titleParser = new TitleParser(PartTypeResolver.Default, new PartParsers {
            SeriesTokenizer = new SeriesTokenizer(),
            TracksTokenizer = new TracksTokenizer(),
            TraitsTokenizer = new TraitsTokenizer(),
            TypesTokenizer = new TypesTokenizer()
        });

        [Test, TestCaseSource("MainTestCases")]
        public void MainTest(string title, Models.Anime expected) {
            var actual = _titleParser.Parse(title);

            Assert.AreEqual(expected, actual);
        }

        private static IEnumerable<TestCaseData> MainTestCases {
            get {
                yield return new TestCaseData(
                    "Трусливый Велосипедист / <NAME> (Набэсима Осаму) [TV] [01-09 из 12] [Без хардсаба] [RUS(int), JAP+SUB] [2013 г., спорт, HDTVRip] [720p]",
                    new Models.Anime {
                        Names = new[] { "<NAME>", "<NAME>" },
                        Types = new[] { Models.Anime.Type.TV },
                        Series = new Series(1, 9, 12),
                        Tracks = new[] { "RUS(int)", "JAP+SUB" },
                        Traits = new Traits(2013, new[] { "спорт" }, "HDTVRip")
                    });
                yield return new TestCaseData(
                    "Прекрасные деньки / Деревенская глубинка / Глухомань / Non Non Biyori (Кавамо Синъя) [TV] [01-10 из 12] [Без хардсаба] [RUS(int), JAP+SUB] [2013 г., комедия, повседневность, HDTVRip] [720p]",
                    new Models.Anime {
                        Names = new[] { "Прекрасные деньки", "Деревенская глубинка", "Глухомань", "Non Non Biyori" },
                        Types = new[] { Models.Anime.Type.TV },
                        Series = new Series(1, 10, 12),
                        Tracks = new[] { "RUS(int)", "JAP+SUB" },
                        Traits = new Traits(2013, new[] { "комедия", "повседневность" }, "HDTVRip")
                    });
                yield return new TestCaseData(
                    "Кейон!! [ТВ-2] / Кей-Он / K-On!! (Ямада Наоко) [TV+Special] [24+9 из 24+9] [без хардсабa] [RUS(ext), JAP+SUB] [2010 г., комедия, музыкальный, школа, BDRip] [1080p]",
                    new Models.Anime {
                        Names = new[] { "Кейон!!", "Кей-Он", "K-On!!" },
                        Types = new[] { Models.Anime.Type.TV, Models.Anime.Type.Special },
                        Series = new Series(24, 24),
                        Tracks = new[] { "RUS(ext)", "JAP+SUB" },
                        Traits = new Traits(2010, new[] { "комедия", "музыкальный", "школа" }, "BDRip")
                    });
            }
        }
    }
{'fraction_non_alphanumeric': 0.12252878557462525, 'fraction_numerical': 0.018900716923745384, 'mean_word_length': 1.8332307692307692, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6939977', 'n_tokens_mistral': 1498, 'n_tokens_neox': 1412, 'n_words': 324}