<commit_before>﻿// -----------------------------------------------------------------------
// <copyright file="SelectorTests_Descendent.cs" company="<NAME>">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

namespace Perspex.Styling.UnitTests
{
    using System;
    using System.Linq;
    using System.Reactive.Linq;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Moq;
    using Perspex.Styling;

    [TestClass]
    public class SelectorTests_Descendent
    {
        [TestMethod]
        public void Descendent_Matches_Control_When_It_Is_Child_OfType()
        {
            throw new NotImplementedException();
            ////var parent = new Mock<TestLogical1>();
            ////var child = new Mock<TestLogical2>();
 
            ////child.Setup(x => x.LogicalParent).Returns(parent.Object);

            ////var selector = new Selector().OfType(parent.Object.GetType()).Descendent().OfType(child.Object.GetType());

            ////Assert.IsTrue(ActivatorValue(selector, child.Object));
        }

        [TestMethod]
        public void Descendent_Matches_Control_When_It_Is_Descendent_OfType()
        {
            throw new NotImplementedException();
            ////var grandparent = new Mock<TestLogical1>();
            ////var parent = new Mock<TestLogical2>();
            ////var child = new Mock<TestLogical3>();

            ////parent.Setup(x => x.LogicalParent).Returns(grandparent.Object);
            ////child.Setup(x => x.LogicalParent).Returns(parent.Object);

            ////var selector = new Selector().OfType(grandparent.Object.GetType()).Descendent().OfType(child.Object.GetType());

            ////Assert.IsTrue(ActivatorValue(selector, child.Object));
        }

        [TestMethod]
        public void Descendent_Matches_Control_When_It_Is_Descendent_OfType_And_Class()
        {
            throw new NotImplementedException();
            ////var grandparent = new Mock<TestLogical1>();
            ////var parent = new Mock<TestLogical2>();
            ////var child = new Mock<TestLogical3>();

            ////grandparent.Setup(x => x.Classes).Returns(new Classes("foo"));
            ////parent.Setup(x => x.LogicalParent).Returns(grandparent.Object);
            ////parent.Setup(x => x.Classes).Returns(new Classes());
            ////child.Setup(x => x.LogicalParent).Returns(parent.Object);

            ////var selector = new Selector().OfType(grandparent.Object.GetType()).Class("foo").Descendent().OfType(child.Object.GetType());

            ////Assert.IsTrue(ActivatorValue(selector, child.Object));
        }

        [TestMethod]
        public void Descendent_Doesnt_Match_Control_When_It_Is_Descendent_OfType_But_Wrong_Class()
        {
            throw new NotImplementedException();
            ////var grandparent = new Mock<TestLogical1>();
            ////var parent = new Mock<TestLogical2>();
            ////var child = new Mock<TestLogical3>();

            ////grandparent.Setup(x => x.Classes).Returns(new Classes("bar"));
            ////parent.Setup(x => x.LogicalParent).Returns(grandparent.Object);
            ////parent.Setup(x => x.Classes).Returns(new Classes("foo"));
            ////child.Setup(x => x.LogicalParent).Returns(parent.Object);

            ////var selector = new Selector().OfType<TestLogical1>().Class("foo").Descendent().OfType<TestLogical3>();

            ////Assert.IsFalse(ActivatorValue(selector, child.Object));
        }

        private static bool ActivatorValue(Selector selector, IStyleable control)
        {
            return selector.GetActivator(control).Take(1).ToEnumerable().Single();
        }

        ////public abstract class TestLogical1 : TestLogical
        ////{
        ////}
<commit_msg>Assert inconclusive for unimplemented features.<commit_after>﻿// -----------------------------------------------------------------------
// <copyright file="SelectorTests_Descendent.cs" company="<NAME>">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

namespace Perspex.Styling.UnitTests
{
    using System;
    using System.Linq;
    using System.Reactive.Linq;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Moq;
    using Perspex.Styling;

    [TestClass]
    public class SelectorTests_Descendent
    {
        [TestMethod]
        public void Descendent_Matches_Control_When_It_Is_Child_OfType()
        {
            Assert.Inconclusive("Need to implement logical tree.");
            ////var parent = new Mock<TestLogical1>();
            ////var child = new Mock<TestLogical2>();
 
            ////child.Setup(x => x.LogicalParent).Returns(parent.Object);

            ////var selector = new Selector().OfType(parent.Object.GetType()).Descendent().OfType(child.Object.GetType());

            ////Assert.IsTrue(ActivatorValue(selector, child.Object));
        }

        [TestMethod]
        public void Descendent_Matches_Control_When_It_Is_Descendent_OfType()
        {
            Assert.Inconclusive("Need to implement logical tree.");
            ////var grandparent = new Mock<TestLogical1>();
            ////var parent = new Mock<TestLogical2>();
            ////var child = new Mock<TestLogical3>();

            ////parent.Setup(x => x.LogicalParent).Returns(grandparent.Object);
            ////child.Setup(x => x.LogicalParent).Returns(parent.Object);

            ////var selector = new Selector().OfType(grandparent.Object.GetType()).Descendent().OfType(child.Object.GetType());

            ////Assert.IsTrue(ActivatorValue(selector, child.Object));
        }

        [TestMethod]
        public void Descendent_Matches_Control_When_It_Is_Descendent_OfType_And_Class()
        {
            Assert.Inconclusive("Need to implement logical tree.");
            ////var grandparent = new Mock<TestLogical1>();
            ////var parent = new Mock<TestLogical2>();
            ////var child = new Mock<TestLogical3>();

            ////grandparent.Setup(x => x.Classes).Returns(new Classes("foo"));
            ////parent.Setup(x => x.LogicalParent).Returns(grandparent.Object);
            ////parent.Setup(x => x.Classes).Returns(new Classes());
            ////child.Setup(x => x.LogicalParent).Returns(parent.Object);

            ////var selector = new Selector().OfType(grandparent.Object.GetType()).Class("foo").Descendent().OfType(child.Object.GetType());

            ////Assert.IsTrue(ActivatorValue(selector, child.Object));
        }

        [TestMethod]
        public void Descendent_Doesnt_Match_Control_When_It_Is_Descendent_OfType_But_Wrong_Class()
        {
            Assert.Inconclusive("Need to implement logical tree.");
            ////var grandparent = new Mock<TestLogical1>();
            ////var parent = new Mock<TestLogical2>();
            ////var child = new Mock<TestLogical3>();

            ////grandparent.Setup(x => x.Classes).Returns(new Classes("bar"));
            ////parent.Setup(x => x.LogicalParent).Returns(grandparent.Object);
            ////parent.Setup(x => x.Classes).Returns(new Classes("foo"));
            ////child.Setup(x => x.LogicalParent).Returns(parent.Object);

            ////var selector = new Selector().OfType<TestLogical1>().Class("foo").Descendent().OfType<TestLogical3>();

            ////Assert.IsFalse(ActivatorValue(selector, child.Object));
        }

        private static bool ActivatorValue(Selector selector, IStyleable control)
        {
            return selector.GetActivator(control).Take(1).ToEnumerable().Single();
        }

        ////public abstract class TestLogical1 : TestLogical
        ////{
        ////}

{'fraction_non_alphanumeric': 0.18175987685992817, 'fraction_numerical': 0.0048742945100051305, 'mean_word_length': 2.1088516746411483, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 57, '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': '7655178', 'n_tokens_mistral': 2148, 'n_tokens_neox': 2026, 'n_words': 348}