<commit_before>﻿using CodeNav.Helpers;
using CodeNav.Mappers;
using CodeNav.Models;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows;

namespace CodeNav.Tests.HelperTests
{
    [TestFixture]
    public class VisibilityHelperTests
    {
        [TestCase(false, Visibility.Visible)]
        [TestCase(true, Visibility.Collapsed)]
        public void EmptyItemsShouldRespectSetting(bool hideItemsWithoutChildren, Visibility expectedVisibility)
        {
            var document = new CodeDocumentViewModel
            {
                CodeDocument = SyntaxMapper.MapDocument(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\Files\\TestVisibility.cs"))
            };

            SettingsHelper.FilterRules = new List<FilterRule>
            {
                new FilterRule
                {
                    Access = CodeItemAccessEnum.All,
                    Kind = CodeItemKindEnum.Class,
                    HideIfEmpty = hideItemsWithoutChildren
                }
            };

            VisibilityHelper.SetCodeItemVisibility(document.CodeDocument);

            var firstClass = (document.CodeDocument.First() as IMembers).Members.First() as CodeClassItem;          

            Assert.AreEqual(expectedVisibility, firstClass.IsVisible);
        }
    }
}<commit_msg>:white_check_mark: Fix Test<commit_after>﻿using CodeNav.Helpers;
using CodeNav.Mappers;
using CodeNav.Models;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows;

namespace CodeNav.Tests.HelperTests
{
    [TestFixture]
    public class VisibilityHelperTests
    {
        [TestCase(false, Visibility.Visible)]
        [TestCase(true, Visibility.Collapsed)]
        public void EmptyItemsShouldRespectSetting(bool hideItemsWithoutChildren, Visibility expectedVisibility)
        {
            var document = new CodeDocumentViewModel
            {
                CodeDocument = SyntaxMapper.MapDocument(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\Files\\TestVisibility.cs"))
            };

            SettingsHelper.FilterRules = new List<FilterRule>
            {
                new FilterRule
                {
                    Access = CodeItemAccessEnum.All,
                    Kind = CodeItemKindEnum.Class,
                    Visible = true,
                    HideIfEmpty = hideItemsWithoutChildren
                }
            };

            VisibilityHelper.SetCodeItemVisibility(document.CodeDocument);

            var firstClass = (document.CodeDocument.First() as IMembers).Members.First() as CodeClassItem;          

            Assert.AreEqual(expectedVisibility, firstClass.IsVisible);
        }
    }
}
{'fraction_non_alphanumeric': 0.08214285714285714, 'fraction_numerical': 0.0, 'mean_word_length': 2.2195402298850575, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2396368', 'n_tokens_mistral': 706, 'n_tokens_neox': 678, 'n_words': 128}