<commit_before>﻿using System;
using System.Reflection;
using FakeItEasy;
using KenticoCloud.Delivery.InlineContentItems;
using Newtonsoft.Json.Linq;
using Xunit;

namespace KenticoCloud.Delivery.Tests
{
    public class CodeFirstModelProviderTests
    {
        [Fact]
        // During processing of inline content items, item which detects circular dependency ( A refs B, B refs A ) should resolve resolved item
        // as if there were no inline content items, which will prevent circular dependency
        public void RetrievingContentModelWithCircularDependencyDoesNotCycle()
        {
            var codeFirstTypeProvider = A.Fake<ICodeFirstTypeProvider>();
            var contentLinkUrlResolver = A.Fake<IContentLinkUrlResolver>();
            var propertyMapper = A.Fake<ICodeFirstPropertyMapper>(); //new CodeFirstPropertyMapper();
            A.CallTo(() => propertyMapper.IsMatch(A<PropertyInfo>._, A<string>._, A<string>._)).Returns(true);
            A.CallTo(() => codeFirstTypeProvider.GetType(A<string>._)).Returns(typeof(ContentItemWithSingleRTE));

            var processor = new InlineContentItemsProcessor(null, null);
            processor.RegisterTypeResolver(new RichTextInlineResolver());
            var retriever = new CodeFirstModelProvider(contentLinkUrlResolver, processor, codeFirstTypeProvider, propertyMapper);
<commit_msg>Update CodeFirstModelProviderTests.cs<commit_after>﻿using System;
using System.Reflection;
using FakeItEasy;
using KenticoCloud.Delivery.InlineContentItems;
using Newtonsoft.Json.Linq;
using Xunit;

namespace KenticoCloud.Delivery.Tests
{
    public class CodeFirstModelProviderTests
    {
        [Fact]
        // During processing of inline content items, item which detects circular dependency ( A refs B, B refs A ) should resolve resolved item
        // as if there were no inline content items, which will prevent circular dependency
        public void RetrievingContentModelWithCircularDependencyDoesNotCycle()
        {
            var codeFirstTypeProvider = A.Fake<ICodeFirstTypeProvider>();
            var contentLinkUrlResolver = A.Fake<IContentLinkUrlResolver>();
            var propertyMapper = A.Fake<ICodeFirstPropertyMapper>();
            A.CallTo(() => propertyMapper.IsMatch(A<PropertyInfo>._, A<string>._, A<string>._)).Returns(true);
            A.CallTo(() => codeFirstTypeProvider.GetType(A<string>._)).Returns(typeof(ContentItemWithSingleRTE));

            var processor = new InlineContentItemsProcessor(null, null);
            processor.RegisterTypeResolver(new RichTextInlineResolver());
            var retriever = new CodeFirstModelProvider(contentLinkUrlResolver, processor, codeFirstTypeProvider, propertyMapper);

{'fraction_non_alphanumeric': 0.08766114180478822, 'fraction_numerical': 0.0, 'mean_word_length': 3.98348623853211, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, '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': '134690', 'n_tokens_mistral': 683, 'n_tokens_neox': 684, 'n_words': 171}