Пример #1
0
        public void ButtonGroupUpdateButton()
        {
            tlog.Debug(tag, $"ButtonGroupUpdateButton START");

            using (View view = new View()
            {
                Size = new Size(100, 200), LayoutDirection = ViewLayoutDirectionType.RTL
            })
            {
                var testingTarget = new ButtonGroup(view);
                Assert.IsNotNull(testingTarget, "null handle");
                Assert.IsInstanceOf <ButtonGroup>(testingTarget, "Should return ButtonGroup instance.");

                Button bt1 = new Button()
                {
                    Size = new Size(20, 30)
                };
                testingTarget.AddItem(bt1);
                tlog.Debug(tag, "Count : " + testingTarget.Count);

                Button bt2 = new Button()
                {
                    Size = new Size(20, 40)
                };
                testingTarget.AddItem(bt2);
                tlog.Debug(tag, "Count : " + testingTarget.Count);

                try
                {
                    ButtonStyle btStyle = new ButtonStyle()
                    {
                        Size = new Size(100, 80),
                        Text = new TextLabelStyle()
                        {
                            TextColor = new Selector <Color> {
                                All = Color.Yellow
                            },
                        }
                    };
                    testingTarget.UpdateButton(btStyle);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception : Failed!");
                }

                testingTarget.RemoveAll();

                bt1.Dispose();
                bt2.Dispose();
                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ButtonGroupUpdateButton End");
        }