<commit_before>﻿using Microsoft.Fx.Portability.ObjectModel;
using Microsoft.Fx.Portability.Tests.TestData;
using Xunit;

namespace Microsoft.Fx.Portability.Tests.ObjectModel
{
    public class CloudApiCatalogLookupTests
    {
        [InlineData("N:System.Collections", null)]
        [InlineData("M:System.Collections.Concurrent.ConcurrentBag`1.get_Count", "P:System.Collections.Concurrent.ConcurrentBag`1.Count;T:System.Collections.Concurrent.ConcurrentBag`1;N:System.Collections.Concurrent")]
        [InlineData("T:System.Collections.Concurrent.ConcurrentBag`1", "N:System.Collections.Concurrent")]
        [Theory]
        public void GetAncestorsTest(string docId, string ancestors)
        {
            var dotnetCatalog = new TestDotNetCatalog();
            var catalog = new CloudApiCatalogLookup(dotnetCatalog);

            var expected = ancestors != null ? ancestors.Split(';') : null;

            int index = 0;

            foreach (var result in catalog.GetAncestors(docId))
            {
                Assert.Equal(expected[index], result);
                index++;
            }
        }

        [InlineData("N:System.Collections.Concurrent")]
        [Theory]
        public void GetAncestorsTestEmpty(string docId)
        {
            var dotnetCatalog = new TestDotNetCatalog();
            var catalog = new CloudApiCatalogLookup(dotnetCatalog);

            var results = catalog.GetAncestors(docId);

            Assert.Empty(results);
        }<commit_msg>Adding test case for non-existent docId<commit_after>﻿using Microsoft.Fx.Portability.ObjectModel;
using Microsoft.Fx.Portability.Tests.TestData;
using Xunit;

namespace Microsoft.Fx.Portability.Tests.ObjectModel
{
    public class CloudApiCatalogLookupTests
    {
        [InlineData("N:System.Collections", null)]
        [InlineData("M:System.Collections.Concurrent.ConcurrentBag`1.get_Count", "P:System.Collections.Concurrent.ConcurrentBag`1.Count;T:System.Collections.Concurrent.ConcurrentBag`1;N:System.Collections.Concurrent")]
        [InlineData("T:System.Collections.Concurrent.ConcurrentBag`1", "N:System.Collections.Concurrent")]
        [Theory]
        public void GetAncestorsTest(string docId, string ancestors)
        {
            var dotnetCatalog = new TestDotNetCatalog();
            var catalog = new CloudApiCatalogLookup(dotnetCatalog);

            var expected = ancestors != null ? ancestors.Split(';') : null;

            int index = 0;

            foreach (var result in catalog.GetAncestors(docId))
            {
                Assert.Equal(expected[index], result);
                index++;
            }
        }

        [InlineData("N:System.Collections.Concurrent")]
        [InlineData("N:NonExistentDocId")]
        [Theory]
        public void GetAncestorsTestEmpty(string docId)
        {
            var dotnetCatalog = new TestDotNetCatalog();
            var catalog = new CloudApiCatalogLookup(dotnetCatalog);

            var results = catalog.GetAncestors(docId);

            Assert.Empty(results);
        }
{'fraction_non_alphanumeric': 0.104296490652673, 'fraction_numerical': 0.0032797638570022957, 'mean_word_length': 2.7747524752475248, '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': '2500385', 'n_tokens_mistral': 843, 'n_tokens_neox': 848, 'n_words': 140}