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

using OpenTK;
using OpenTK.Graphics;
using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.MathUtils;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;

namespace osu.Framework.VisualTests.Tests
{
    class TestCaseDropDownBox : TestCase
    {
        public override string Name => @"Drop-down boxes";

        public override string Description => @"Drop-down boxes";

        private StyledDropDownMenu styledDropDownMenu;

        public override void Reset()
        {
            base.Reset();
            string[] testItems = new string[10];
            for (int i = 0; i < 10; i++)
                testItems[i] = @"test " + i;
            styledDropDownMenu = new StyledDropDownMenu
            {
                Width = 150,
                Position = new Vector2(200, 70),
                Description = @"Drop-down menu",
                Depth = 1,
                Items = testItems,
                SelectedIndex = 4,
            };
            Add(styledDropDownMenu);
        }

        private class StyledDropDownMenu : DropDownMenu<string>
        {
            protected override DropDownHeader CreateHeader()
            {
                return new StyledDropDownHeader();
            }
            
            protected override IEnumerable<DropDownMenuItem<string>> GetDropDownItems(IEnumerable<string> values)
            {
                return values.Select(v => new StyledDropDownMenuItem(v));
            }

            public StyledDropDownMenu()
            {
                Header.CornerRadius = 4;
                ContentContainer.CornerRadius = 4;
            }

            protected override void AnimateOpen()
            {
                ContentContainer.Show();
            }

            protected override void AnimateClose()
            {
                ContentContainer.Hide();
            }
        }

        private class StyledDropDownHeader : DropDownHeader
        {<commit_msg>Update dropdown test case<commit_after>﻿// Copyright (c) 2007-2016 ppy Pty Ltd <<EMAIL>@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

using OpenTK;
using OpenTK.Graphics;
using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.MathUtils;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;

namespace osu.Framework.VisualTests.Tests
{
    class TestCaseDropDownBox : TestCase
    {
        public override string Name => @"Drop-down boxes";

        public override string Description => @"Drop-down boxes";

        private StyledDropDownMenu styledDropDownMenu;

        public override void Reset()
        {
            base.Reset();
            string[] testItems = new string[10];
            for (int i = 0; i < 10; i++)
                testItems[i] = @"test " + i;
            styledDropDownMenu = new StyledDropDownMenu
            {
                Width = 150,
                Position = new Vector2(200, 70),
                Description = @"Drop-down menu",
                Depth = 1,
                Items = testItems.Select(i => new KeyValuePair<string, string>(i, i)),
                SelectedIndex = 4,
            };
            Add(styledDropDownMenu);
        }

        private class StyledDropDownMenu : DropDownMenu<string>
        {
            protected override DropDownHeader CreateHeader()
            {
                return new StyledDropDownHeader();
            }
            
            protected override IEnumerable<DropDownMenuItem<string>> GetDropDownItems(IEnumerable<KeyValuePair<string, string>> values)
            {
                return values.Select(v => new StyledDropDownMenuItem(v.Key));
            }

            public StyledDropDownMenu()
            {
                Header.CornerRadius = 4;
                ContentContainer.CornerRadius = 4;
            }

            protected override void AnimateOpen()
            {
                ContentContainer.Show();
            }

            protected override void AnimateClose()
            {
                ContentContainer.Hide();
            }
        }

        private class StyledDropDownHeader : DropDownHeader
        {
{'fraction_non_alphanumeric': 0.08674234311415721, 'fraction_numerical': 0.01113728849860784, 'mean_word_length': 1.8423615337796713, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 24, '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': '2648124', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1154, 'n_words': 276}