<commit_before>// Copyright (c) 2007-2018 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using NUnit.Framework;
using osu.Framework.Allocation;

namespace osu.Framework.Tests.Dependencies
{
    [TestFixture]
    public class DependencyCachedAttributeTest
    {
        [Test]
        public void TestCacheCtor()
        {
            IReadOnlyDependencyContainer dependencies = new DependencyContainer();

            var provider = new Provider1();

            dependencies = DependencyActivator.BuildDependencies(provider, dependencies);

            Assert.AreEqual(provider, dependencies.Get<Provider1>());
        }

        [Test]
        public void TestCacheCtorAsBase()
        {
            IReadOnlyDependencyContainer dependencies = new DependencyContainer();

            var provider = new Provider2();

            dependencies = DependencyActivator.BuildDependencies(provider, dependencies);

            Assert.AreEqual(provider, dependencies.Get<object>());
        }

        [DependencyCached]
        private class Provider1
        {
        }

        [DependencyCached(typeof(object))]
        private class Provider2
        {
        }
    }
}<commit_msg>Rename methods<commit_after>// Copyright (c) 2007-2018 ppy Pty Ltd <<EMAIL>>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using NUnit.Framework;
using osu.Framework.Allocation;

namespace osu.Framework.Tests.Dependencies
{
    [TestFixture]
    public class DependencyCachedAttributeTest
    {
        [Test]
        public void TestCacheType()
        {
            IReadOnlyDependencyContainer dependencies = new DependencyContainer();

            var provider = new Provider1();

            dependencies = DependencyActivator.BuildDependencies(provider, dependencies);

            Assert.AreEqual(provider, dependencies.Get<Provider1>());
        }

        [Test]
        public void TestCacheTypeAsParentClass()
        {
            IReadOnlyDependencyContainer dependencies = new DependencyContainer();

            var provider = new Provider2();

            dependencies = DependencyActivator.BuildDependencies(provider, dependencies);

            Assert.AreEqual(provider, dependencies.Get<object>());
        }

        [DependencyCached]
        private class Provider1
        {
        }

        [DependencyCached(typeof(object))]
        private class Provider2
        {
        }
    }
}
{'fraction_non_alphanumeric': 0.08846761453396525, 'fraction_numerical': 0.010268562401263823, 'mean_word_length': 2.46986301369863, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '1889991', 'n_tokens_mistral': 672, 'n_tokens_neox': 618, 'n_words': 133}