<commit_before>﻿/* ------------------------------------------------------------------------- */
//
// Copyright (c) 2010 CubeSoft, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/* ------------------------------------------------------------------------- */
using Cube.Net.App.Rss.Reader;
using Cube.Net.Rss;
using NUnit.Framework;
using System.Globalization;

namespace Cube.Net.App.Rss.Tests
{
    /* --------------------------------------------------------------------- */
    ///
    /// TitleConverterTest
    ///
    /// <summary>
    /// タイトル変換のテスト用クラスです。
    /// </summary>
    ///
    /* --------------------------------------------------------------------- */
    [TestFixture]
    class TitleConverterTest
    {
        #region TitleConverter

        /* ----------------------------------------------------------------- */
        ///
        /// Convert_Title
        ///
        /// <summary>
        /// タイトルの変換テストを実行します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        public void Convert_Title() => Assert.That(
            Convert(new RssItem { Title = "TitleTest" }, new LockSettings()),
            Is.EqualTo("TitleTest - Cube.Core")
        );

        /* ----------------------------------------------------------------- */
        ///
        /// Convert_Title_Null
        ///
        /// <summary>
        /// タイトルの変換時に null が指定された時の挙動を確認します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        public void Convert_Title_Null() => Assert.That(
            Convert(null, new LockSettings()),
            Is.EqualTo("Cube.Core")
        );

        #endregion

        #region Helper methods

        /* ----------------------------------------------------------------- */
        ///
        /// Convert
        ///
        /// <summary>
        /// Convert メソッドを実行します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private string Convert(RssItem src, LockSettings settings) =>
            new TitleConverter().Convert(
                new object[] { src, settings },
                typeof(string),
                null,
                CultureInfo.CurrentCulture
            ) as string;

        #endregion
    }
}
<commit_msg>Update tests.<commit_after>﻿/* ------------------------------------------------------------------------- */
//
// Copyright (c) 2010 CubeSoft, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/* ------------------------------------------------------------------------- */
using Cube.Net.App.Rss.Reader;
using Cube.Net.Rss;
using NUnit.Framework;
using System.Globalization;

namespace Cube.Net.App.Rss.Tests
{
    /* --------------------------------------------------------------------- */
    ///
    /// TitleConverterTest
    ///
    /// <summary>
    /// タイトル変換のテスト用クラスです。
    /// </summary>
    ///
    /* --------------------------------------------------------------------- */
    [TestFixture]
    class TitleConverterTest
    {
        #region TitleConverter

        /* ----------------------------------------------------------------- */
        ///
        /// Convert_Title
        ///
        /// <summary>
        /// タイトルの変換テストを実行します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        [Test]
        public void Convert_Title() => Assert.That(
            Convert(new RssItem { Title = "TitleTest" }, new LockSettings()),
            Is.EqualTo("TitleTest - Cube.Core")
        );

        /* ----------------------------------------------------------------- */
        ///
        /// Convert_Title_Null
        ///
        /// <summary>
        /// タイトルの変換時に null が指定された時の挙動を確認します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        [Test]
        public void Convert_Title_Null() => Assert.That(
            Convert(null, new LockSettings()),
            Is.EqualTo("Cube.Core")
        );

        #endregion

        #region Helper methods

        /* ----------------------------------------------------------------- */
        ///
        /// Convert
        ///
        /// <summary>
        /// Convert メソッドを実行します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private string Convert(RssItem src, LockSettings settings) =>
            new TitleConverter().Convert(
                new object[] { src, settings },
                typeof(string),
                null,
                CultureInfo.CurrentCulture
            ) as string;

        #endregion
    }
}

{'fraction_non_alphanumeric': 0.33705740804400136, 'fraction_numerical': 0.002750085940185631, 'mean_word_length': 0.83160214038401, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6268867', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1301, 'n_words': 323}