コード例 #1
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void TextColorSelector_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            var colorSelector = new ColorSelector
            {
                Normal   = new Color(0.0f, 0.0f, 1.0f, 1.0f),
                Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f),
            };

            Assert.IsNotNull(colorSelector, "Should be not null");
            Assert.IsInstanceOf <ColorSelector>(colorSelector, "Should be equal!");

            button.TextColorSelector = colorSelector;
            Assert.AreEqual(colorSelector.Normal.R, button.TextColorSelector.Normal.R, "Should be equals to the set value of TextColorSelector Normal R");
            Assert.AreEqual(colorSelector.Normal.G, button.TextColorSelector.Normal.G, "Should be equals to the set value of TextColorSelector Normal G");
            Assert.AreEqual(colorSelector.Normal.B, button.TextColorSelector.Normal.B, "Should be equals to the set value of TextColorSelector Normal B");
            Assert.AreEqual(colorSelector.Normal.A, button.TextColorSelector.Normal.A, "Should be equals to the set value of TextColorSelector Normal A");

            Assert.AreEqual(colorSelector.Selected.R, button.TextColorSelector.Selected.R, "Should be equals to the set value of TextColorSelector Selected R");
            Assert.AreEqual(colorSelector.Selected.G, button.TextColorSelector.Selected.G, "Should be equals to the set value of TextColorSelector Selected G");
            Assert.AreEqual(colorSelector.Selected.B, button.TextColorSelector.Selected.B, "Should be equals to the set value of TextColorSelector Selected B");
            Assert.AreEqual(colorSelector.Selected.A, button.TextColorSelector.Selected.A, "Should be equals to the set value of TextColorSelector Selected A");
        }
コード例 #2
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void Button_CHECK_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be an instance of Button!");
        }
コード例 #3
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void FontFamily_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            button.FontFamily = "SamsungOne 500";
            Assert.AreEqual("SamsungOne 500", button.FontFamily, "Should be equals to the set value of FontFamily");
        }
コード例 #4
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void PointSize_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            button.PointSize = 10.0f;
            Assert.AreEqual(10.0f, button.PointSize, "Should be equals to the set value of PointSize");
        }
コード例 #5
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void Text_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            button.Text = "Test Text";
            Assert.AreEqual("Test Text", button.Text, "Should be equals to the set value of Text");
        }
コード例 #6
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void IconURL_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            button.IconURL = _image_path;
            Assert.AreEqual(_image_path, button.IconURL, "Should be equals to the set value of IconURL");
        }
コード例 #7
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void IsSelectable_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            button.IsSelectable = true;
            Assert.AreEqual(true, button.IsSelectable, "Should be equals to the set value");
            button.IsSelectable = false;
            Assert.AreEqual(false, button.IsSelectable, "Should be equals to the set value");
        }
コード例 #8
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void IsEnabled_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");

            button.IsEnabled = true;
            Assert.AreEqual(true, button.IsEnabled, "Retrieved IsEnabled should be equal to set value");
            button.IsEnabled = false;
            Assert.AreEqual(false, button.IsEnabled, "Retrieved IsEnabled should be equal to set value");
        }
コード例 #9
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void TranslatableText_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            if (NUIApplication.MultilingualResourceManager != null)
            {
                button.TranslatableText = "Test TranslatableText";
                Assert.AreEqual("Test TranslatableText", button.TranslatableText, "Should be equals to the set value of TranslatableText");
            }
        }
コード例 #10
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void Style_CHECK_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be an instance of Button!");

            var style = button.Style;

            Assert.IsNotNull(style, "Should be not null");
            Assert.IsInstanceOf <ButtonStyle>(style, "Should be an instance of ButtonStyle!");
        }
コード例 #11
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void TextPadding_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");

            button.TextPadding = new Extents(0, 0, 10, 10);
            Assert.AreEqual(0, button.TextPadding.Start, "Retrieved TextPadding.Start should be equal to set value");
            Assert.AreEqual(0, button.TextPadding.End, "Retrieved TextPadding.End should be equal to set value");
            Assert.AreEqual(10, button.TextPadding.Top, "Retrieved TextPadding.Top should be equal to set value");
            Assert.AreEqual(10, button.TextPadding.Bottom, "Retrieved TextPadding.Bottom should be equal to set value");
        }
コード例 #12
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void TextAlignment_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            button.TextAlignment = HorizontalAlignment.Begin;
            Assert.AreEqual(HorizontalAlignment.Begin, button.TextAlignment, "Should be equals to the set value of TextAlignment");
            button.TextAlignment = HorizontalAlignment.Center;
            Assert.AreEqual(HorizontalAlignment.Center, button.TextAlignment, "Should be equals to the set value of TextAlignment");
            button.TextAlignment = HorizontalAlignment.End;
            Assert.AreEqual(HorizontalAlignment.End, button.TextAlignment, "Should be equals to the set value of TextAlignment");
        }
コード例 #13
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
 public void IconURLSelector_SET_GET_VALUE_Exception()
 {
     /* TEST CODE */
     try
     {
         var button = new Components.Button();
         Assert.IsNotNull(button, "Should be not null");
         Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
         button.IconURLSelector = null;
         Assert.Fail("Should throw the NullReferenceException!");
     }
     catch (NullReferenceException e)
     {
         Assert.Pass("NullReferenceException: passed!");
     }
 }
コード例 #14
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void TextColor_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            var color = new Color(1.0f, 0.0f, 0.0f, 1.0f);

            Assert.IsNotNull(color, "Should be not null");
            Assert.IsInstanceOf <Color>(color, "Should be equal!");
            button.TextColor = color;

            Assert.AreEqual(color.R, button.TextColor.R, "Should be equals to the color.R set");
            Assert.AreEqual(color.G, button.TextColor.G, "Should be equals to the color.G set");
            Assert.AreEqual(color.B, button.TextColor.B, "Should be equals to the color.B set");
            Assert.AreEqual(color.A, button.TextColor.A, "Should be equals to the color.A set");
        }
コード例 #15
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void PointSizeSelector_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            var floatSelector = new FloatSelector
            {
                Normal   = 10.0f,
                Selected = 12.0f,
            };

            Assert.IsNotNull(floatSelector, "Should be not null");
            Assert.IsInstanceOf <FloatSelector>(floatSelector, "Should be equal!");

            button.PointSizeSelector = floatSelector;
            Assert.AreEqual(floatSelector.Normal, button.PointSizeSelector.Normal, "Should be equals to the set value of PointSizeSelector Normal");
            Assert.AreEqual(floatSelector.Selected, button.PointSizeSelector.Selected, "Should be equals to the set value of PointSizeSelector Selected");
        }
コード例 #16
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void IconURLSelector_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            var stringSelector = new StringSelector
            {
                Normal   = _image_path,
                Selected = _image_path,
            };

            Assert.IsNotNull(stringSelector, "Should be not null");
            Assert.IsInstanceOf <StringSelector>(stringSelector, "Should be equal!");

            button.IconURLSelector = stringSelector;
            Assert.AreEqual(stringSelector.Normal, button.IconURLSelector.Normal, "Should be equals to the set value of IconURLSelector Normal");
            Assert.AreEqual(stringSelector.Selected, button.IconURLSelector.Selected, "Should be equals to the set value of IconURLSelector Selected");
        }
コード例 #17
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void TextSelector_SET_GET_VALUE()
        {
            /* TEST CODE */
            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            var stringSelector = new StringSelector
            {
                Normal   = "Normal",
                Selected = "Selected",
            };

            Assert.IsNotNull(stringSelector, "Should be not null");
            Assert.IsInstanceOf <StringSelector>(stringSelector, "Should be equal!");

            button.TextSelector = stringSelector;
            Assert.AreEqual(stringSelector.Normal, button.TextSelector.Normal, "Should be equals to the set value of TextSelector");
            Assert.AreEqual(stringSelector.Selected, button.TextSelector.Selected, "Should be equals to the set value of TextSelector");
        }
コード例 #18
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void OnKey_CHECK_RETURN_VALUE()
        {
            /* TEST CODE */
            try
            {
                var button = new Components.Button();
                Assert.IsNotNull(button, "Should be not null");
                Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");

                bool flag = true;
                flag = button.OnKey(new Key());
                Assert.AreEqual(false, flag, "OnKey return check fail.");
            }
            catch (Exception e)
            {
                Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
                LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }
        }
コード例 #19
0
ファイル: TSButtonExample.cs プロジェクト: yunmiha/TizenFX
        public void TranslatableTextSelector_SET_GET_VALUE()
        {
            /* TEST CODE */
            ResourceManager testRm = new ResourceManager("Tizen.NUI.Devel.Tests.Properties.Resources", typeof(ButtonTests).Assembly);

            NUIApplication.MultilingualResourceManager = testRm;

            var button = new Components.Button();

            Assert.IsNotNull(button, "Should be not null");
            Assert.IsInstanceOf <Components.Button>(button, "Should be equal!");
            var stringSelector = new StringSelector
            {
                Normal   = "Normal",
                Selected = "Selected",
            };

            Assert.IsNotNull(stringSelector, "Should be not null");
            Assert.IsInstanceOf <StringSelector>(stringSelector, "Should be equal!");

            button.TranslatableTextSelector = stringSelector;
            Assert.AreEqual(stringSelector.Normal, button.TranslatableTextSelector.Normal, "Should be equals to the set value of TranslatableTextSelector");
            Assert.AreEqual(stringSelector.Selected, button.TranslatableTextSelector.Selected, "Should be equals to the set value of TranslatableTextSelector");
        }
コード例 #20
0
 public ButtonClicked(Components.Button button)
 {
     this.button = button;
 }
コード例 #21
0
 public ButtonReleased(Components.Button button)
 {
     this.button = button;
 }