Example #1
0
        public void GtfCapabilitiesNamesAreAttributedCorrectly()
        {
            // Just one is enough.
            Assert.AreEqual(".Selectable", Capabilities.Selectable.Name);

            Assert.AreEqual(Capabilities.Selectable, Capabilities.Get(".Selectable"));
        }
Example #2
0
        public void GetFeatureOptionsReturnsEmptyIfFeatureNotFound()
        {
            var pc = new Capabilities(
                new Feature(Exp.SomeFeature,
                            new Option(Exp.SomeOption1),
                            new Option(Exp.SomeOption2)));
            var options = pc.Get(Exp.OtherFeature);

            Assert.Null(options);
        }
Example #3
0
        public void GetFeatureOptionsReturnsEmptyIfFeatureNotFound()
        {
            var pc = new Capabilities(
                new Feature(Exp.SomeFeature,
                    new Option(Exp.SomeOption1),
                    new Option(Exp.SomeOption2)));
            var options = pc.Get(Exp.OtherFeature);

            Assert.Null(options);
        }
Example #4
0
        public void GetFeatureOptionsReturnsOptions()
        {
            var pc = new Capabilities(
                new Feature(Exp.SomeFeature,
                            new Option(Exp.SomeOption1),
                            new Option(Exp.SomeOption2)));
            var options = pc.Get(Exp.SomeFeature)?.Options();

            var expected = new List <XName>()
            {
                Exp.SomeOption1, Exp.SomeOption2
            };

            Assert.Equal(expected, options.Select(x => x.Name));
        }
Example #5
0
        public void GetNestedFeatureOptionsReturnsOptions()
        {
            var pc = new Capabilities(
                new Feature(Exp.SomeFeature,
                    new Feature(Exp.NestedFeature,
                        new Option(Exp.SomeOption1),
                        new Option(Exp.SomeOption2))));
            var options = pc.Get(Exp.SomeFeature, Exp.NestedFeature)?.Options();

            var expected = new List<XName>() { Exp.SomeOption1, Exp.SomeOption2 };
            Assert.Equal(expected, options.Select(x => x.Name));
        }