コード例 #1
0
ファイル: TSDataTemplate.cs プロジェクト: wonrst/TizenFX
        public void DataTemplateSetupContentWithNullBindable()
        {
            tlog.Debug(tag, $"DataTemplateSetupContentWithNullBindable START");

            BindingBase      binding       = new Tizen.NUI.Binding.Binding() as BindingBase;
            BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);

            var testingTarget = new MyDataTemplateTest();

            Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
            Assert.IsInstanceOf <DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");

            testingTarget.SetBinding(stateProperty, binding);

            try
            {
                testingTarget.OnSetupContent(null);
            }
            catch (Exception e)
            {
                Assert.Fail("Fail!");
            }

            tlog.Debug(tag, $"DataTemplateSetupContentWithNullBindable END (OK)");
        }
コード例 #2
0
ファイル: TSDataTemplate.cs プロジェクト: wonrst/TizenFX
        public void DataTemplateSetBindingWithNullBindableProperty()
        {
            tlog.Debug(tag, $"DataTemplateSetBindingWithNullBindableProperty START");

            BindingBase binding = new Tizen.NUI.Binding.Binding() as BindingBase;

            var testingTarget = new DataTemplate();

            Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
            Assert.IsInstanceOf <DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");

            try
            {
                testingTarget.SetBinding(null, binding);
            }
            catch (ArgumentNullException e)
            {
                tlog.Debug(tag, $"DataTemplateSetValueWithNullBindableProperty END (OK)");
                Assert.Pass("Caught ArgumentNullException: Pass!");
            }
        }