Beispiel #1
0
        public void TestInitialLoad()
        {
            var          secondarySource = new SecondarySource();
            SkinConsumer consumer        = null;

            AddStep("setup layout", () =>
            {
                Child = new SkinSourceContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = new LocalSkinOverrideContainer(secondarySource)
                    {
                        RelativeSizeAxes = Axes.Both,
                        Child            = consumer = new SkinConsumer("test", name => new NamedBox("Default Implementation"), source => true)
                    }
                };
            });

            AddAssert("consumer using override source", () => consumer.Drawable is SecondarySourceBox);
            AddAssert("skinchanged only called once", () => consumer.SkinChangedCount == 1);
        }
Beispiel #2
0
        public void TestSwitchOff()
        {
            SkinConsumer consumer = null;
            SwitchableSkinProvidingContainer target = null;

            AddStep("setup layout", () =>
            {
                Child = new SkinSourceContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = target = new SwitchableSkinProvidingContainer(new SecondarySource())
                    {
                        RelativeSizeAxes = Axes.Both,
                    }
                };
            });

            AddStep("add permissive", () => target.Add(consumer = new SkinConsumer("test", name => new NamedBox("Default Implementation"), source => true)));
            AddAssert("consumer using override source", () => consumer.Drawable is SecondarySourceBox);
            AddStep("disable", () => target.Disable());
            AddAssert("consumer using base source", () => consumer.Drawable is BaseSourceBox);
        }
Beispiel #3
0
        public void TestOverride()
        {
            var secondarySource = new SecondarySource();

            SkinConsumer consumer = null;
            Container    target   = null;

            AddStep("setup layout", () =>
            {
                Child = new SkinSourceContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = target = new SkinProvidingContainer(secondarySource)
                    {
                        RelativeSizeAxes = Axes.Both,
                    }
                };
            });

            AddStep("add permissive", () => target.Add(consumer = new SkinConsumer("test", name => new NamedBox("Default Implementation"), source => true)));
            AddAssert("consumer using override source", () => consumer.Drawable is SecondarySourceBox);
            AddAssert("skinchanged only called once", () => consumer.SkinChangedCount == 1);
        }