<commit_before>﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Emby.Naming.Tests.Video
{
    [TestClass]
    public class VideoResolverTests : BaseVideoTest
    {
        [TestMethod]
        public void TestSimpleFile()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\Brave (2007)\\Brave (2006).mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("Brave", result.Name);
            Assert.IsNull(result.ExtraType);
        }

        [TestMethod]
        public void TestSimpleFile2()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\Bad Boys (1995)\\Bad Boys (1995).mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(1995, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("Bad Boys", result.Name);
            Assert.IsNull(result.ExtraType);
        }

        [TestMethod]
        public void TestSimpleFileWithNumericName()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\300 (2007)\\300 (2006).mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("300", result.Name);
            Assert.IsNull(result.ExtraType);
        }

        [TestMethod]
        public void TestExtra()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\Brave (2007)\\Brave (2006)-trailer.mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("trailer", result.ExtraType);
            Assert.AreEqual("Brave (2006)-trailer", result.Name);
        }

        [TestMethod]
        public void TestExtraWithNumericName()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\300 (2007)\\300 (2006)-trailer.mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("300 (2006)-trailer", result.Name);
            Assert.AreEqual("trailer", result.ExtraType);
        }

        [TestMethod]
        public void TestStubFileWithNumericName()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\300 (2007)\\300 (2006).bluray.disc");

            Assert.AreEqual("disc", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(true, result.IsStub);
            Assert.AreEqual("bluray", result.StubType);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("300", result.Name);
            Assert.IsNull(result.ExtraType);
        }

        [TestMethod]
        public void TestStubFile()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\Brave (2007)\\Brave (2006).bluray.disc");

            Assert.AreEqual("disc", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(true, result.IsStub);<commit_msg>Fix unit tests checking ExtraType<commit_after>﻿using MediaBrowser.Model.Entities;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Emby.Naming.Tests.Video
{
    [TestClass]
    public class VideoResolverTests : BaseVideoTest
    {
        [TestMethod]
        public void TestSimpleFile()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\Brave (2007)\\Brave (2006).mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("Brave", result.Name);
            Assert.IsNull(result.ExtraType);
        }

        [TestMethod]
        public void TestSimpleFile2()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\Bad Boys (1995)\\Bad Boys (1995).mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(1995, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("Bad Boys", result.Name);
            Assert.IsNull(result.ExtraType);
        }

        [TestMethod]
        public void TestSimpleFileWithNumericName()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\300 (2007)\\300 (2006).mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("300", result.Name);
            Assert.IsNull(result.ExtraType);
        }

        [TestMethod]
        public void TestExtra()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\Brave (2007)\\Brave (2006)-trailer.mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual(ExtraType.Trailer, result.ExtraType);
            Assert.AreEqual("Brave (2006)-trailer", result.Name);
        }

        [TestMethod]
        public void TestExtraWithNumericName()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\300 (2007)\\300 (2006)-trailer.mkv");

            Assert.AreEqual("mkv", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(false, result.IsStub);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("300 (2006)-trailer", result.Name);
            Assert.AreEqual(ExtraType.Trailer, result.ExtraType);
        }

        [TestMethod]
        public void TestStubFileWithNumericName()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\300 (2007)\\300 (2006).bluray.disc");

            Assert.AreEqual("disc", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(true, result.IsStub);
            Assert.AreEqual("bluray", result.StubType);
            Assert.AreEqual(false, result.Is3D);
            Assert.AreEqual("300", result.Name);
            Assert.IsNull(result.ExtraType);
        }

        [TestMethod]
        public void TestStubFile()
        {
            var parser = GetParser();

            var result =
                parser.ResolveFile(@"\\server\\Movies\\Brave (2007)\\Brave (2006).bluray.disc");

            Assert.AreEqual("disc", result.Container);
            Assert.AreEqual(2006, result.Year);
            Assert.AreEqual(true, result.IsStub);
{'fraction_non_alphanumeric': 0.12912609080561527, 'fraction_numerical': 0.03187049449854559, 'mean_word_length': 1.8662558898151504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5207518', 'n_tokens_mistral': 2373, 'n_tokens_neox': 2133, 'n_words': 353}