Exemple #1
0
            public void XRIDIsGeneratedForRDWithoutCodeBehind()
            {
                var asm        = typeof(ResourceDictionaryWithSource).Assembly;
                var resourceId = XamlResourceIdAttribute.GetResourceIdForPath(asm, "AppResources/Colors.xaml");

                Assert.That(resourceId, Is.Not.Null);
                var type = XamlResourceIdAttribute.GetTypeForResourceId(asm, resourceId);

                Assert.That(type, Is.Null);
            }
Exemple #2
0
            public void CodeBehindIsGeneratedForRDWithXamlComp()
            {
                var asm        = typeof(ResourceDictionaryWithSource).Assembly;
                var resourceId = XamlResourceIdAttribute.GetResourceIdForPath(asm, "AppResources/CompiledColors.xaml");

                Assert.That(resourceId, Is.Not.Null);
                var type = XamlResourceIdAttribute.GetTypeForResourceId(asm, resourceId);

                Assert.That(type, Is.Not.Null);
                var rd = Activator.CreateInstance(type);

                Assert.That(rd as ResourceDictionary, Is.Not.Null);
            }
        public void XamlResourceIdAttributeGetResourceIdForPath()
        {
            tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath START");

            try
            {
                AssemblyImplent assembly = new AssemblyImplent();
                XamlResourceIdAttribute.GetResourceIdForPath(assembly, "myPath");
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath END (OK)");
                Assert.Pass("Caught Exception : passed!");
            }
        }
        public void XamlResourceIdAttributeGetResourceIdForPath2()
        {
            tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath2 START");

            try
            {
                var ret = XamlResourceIdAttribute.GetResourceIdForPath(typeof(UIElement).Assembly, "none.xaml");
                Assert.IsNull(ret, "Should be null");
            }
            catch (Exception e)
            {
                Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath2 END");
        }
        public void XamlResourceIdAttributeGetResourceIdForPath()
        {
            tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath START");

            try
            {
                var ret = XamlResourceIdAttribute.GetResourceIdForPath(typeof(UIElement).Assembly, "testcase.public.Xaml.TotalSample.ClockView.xaml");
                Assert.IsNotNull(ret, "Shouldn't be null");
            }
            catch (Exception e)
            {
                Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath END");
        }