コード例 #1
0
        public void FindOperator_should_implicitly_handle_inherited_operator_names()
        {
            var unit = new PropertyNameLookupHelper();
            var comp = PropertyTreeDefinition.FromType(typeof(ComponentCollection));

            // Though add is defined inside default NS, it is accessible via the NS of the type
            var qn = QualifiedName.Create(comp.Namespace, "add");
            var result = unit.FindOperator(comp, typeof(ComponentCollection), qn);
            Assert.That(result, Is.Not.Null);
        }
コード例 #2
0
        public void FindOperator_should_implicitly_handle_inherited_operator_names_constructed_generics()
        {
            var unit = new PropertyNameLookupHelper();
            var comp = PropertyTreeDefinition.FromType(typeof(Collection<Control>));

            // Though add is defined inside default NS, it is accessible via the NS of the type
            var qn = QualifiedName.Create("https://ns.example.com/", "add");
            var result = unit.FindOperator(comp, typeof(Collection<Control>), qn);

            var ops = comp.EnumerateOperators();
            Assert.That(result, Is.Not.Null);
            Assert.That(result, Is.SameAs(comp.GetOperator("add")));
        }