<commit_before>using System;

using System.Collections.Generic;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using Sdl.Web.Common;

using Sdl.Web.Common.Configuration;

using Sdl.Web.Common.Interfaces;

using Sdl.Web.Common.Models;

using Sdl.Web.Tridion.Linking;

using Sdl.Web.Tridion.Mapping;



namespace Sdl.Web.Tridion.Tests

{

    [TestClass]

    public class DefaultProviderTest

    {

        [TestInitialize]

        public void Initialize()

        {

            TestFixture.InitializeProviders();

            TestRegistration.RegisterCoreViewModels();

        }



        [TestMethod]

        public void GetEntityModel_IsQueryBased_Success()

        {

            string testEntityId = TestFixture.DcpEntityId;



            EntityModel entityModel = SiteConfiguration.ContentProvider.GetEntityModel(testEntityId, TestFixture.ParentLocalization);



            Assert.IsNotNull(entityModel, "entityModel");

            Assert.AreEqual(entityModel.Id, testEntityId, "entityModel.Id");

            Assert.IsNotNull(entityModel.XpmMetadata, "entityModel.XpmMetadata");

            string isQueryBased;

            Assert.IsTrue(entityModel.XpmMetadata.TryGetValue("IsQueryBased", out isQueryBased), "XpmMetadata contains 'IsQueryBased'");

            Assert.AreEqual(isQueryBased, "true", "IsQueryBased value");

        }



        [TestMethod]

        [ExpectedException(typeof(DxaItemNotFoundException))]

        public void GetEntityModel_NonExistent_Exception()

        {

            const string testEntityId = "666-666"; // Should not actually exist

            SiteConfiguration.ContentProvider.GetEntityModel(testEntityId, TestFixture.ParentLocalization);

        }

    }

}

<commit_msg>TSI-1074 Cleaned up unused using statements.<commit_after>using Microsoft.VisualStudio.TestTools.UnitTesting;

using Sdl.Web.Common;

using Sdl.Web.Common.Configuration;

using Sdl.Web.Common.Models;



namespace Sdl.Web.Tridion.Tests

{

    [TestClass]

    public class DefaultProviderTest

    {

        [TestInitialize]

        public void Initialize()

        {

            TestFixture.InitializeProviders();

            TestRegistration.RegisterCoreViewModels();

        }



        [TestMethod]

        public void GetEntityModel_IsQueryBased_Success()

        {

            string testEntityId = TestFixture.DcpEntityId;



            EntityModel entityModel = SiteConfiguration.ContentProvider.GetEntityModel(testEntityId, TestFixture.ParentLocalization);



            Assert.IsNotNull(entityModel, "entityModel");

            Assert.AreEqual(entityModel.Id, testEntityId, "entityModel.Id");

            Assert.IsNotNull(entityModel.XpmMetadata, "entityModel.XpmMetadata");

            string isQueryBased;

            Assert.IsTrue(entityModel.XpmMetadata.TryGetValue("IsQueryBased", out isQueryBased), "XpmMetadata contains 'IsQueryBased'");

            Assert.AreEqual(isQueryBased, "true", "IsQueryBased value");

        }



        [TestMethod]

        [ExpectedException(typeof(DxaItemNotFoundException))]

        public void GetEntityModel_NonExistent_Exception()

        {

            const string testEntityId = "666-666"; // Should not actually exist

            SiteConfiguration.ContentProvider.GetEntityModel(testEntityId, TestFixture.ParentLocalization);

        }

    }

}


{'fraction_non_alphanumeric': 0.5375018788516459, 'fraction_numerical': 0.0024049301067187736, 'mean_word_length': 6.510158013544018, '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': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5926520', 'n_tokens_mistral': 6597, 'n_tokens_neox': 6594, 'n_words': 145}