Exemplo n.º 1
0
        public void TextUtilsCopyToClipboard()
        {
            tlog.Debug(tag, $"TextUtilsCopyToClipboard START");

            TextEditor editor = new TextEditor()
            {
                Text = "editor",
            };
            var result = TextUtils.CopyToClipboard(editor);

            tlog.Debug(tag, "CopyToClipboard : " + result);

            result = TextUtils.CutToClipboard(editor);
            tlog.Debug(tag, "CutToClipboard : " + result);

            try
            {
                TextUtils.PasteTo(editor);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            TextField field = new TextField()
            {
                Text = "field",
            };

            result = TextUtils.CopyToClipboard(field);
            tlog.Debug(tag, "CopyToClipboard : " + field);

            result = TextUtils.CutToClipboard(field);
            tlog.Debug(tag, "CutToClipboard : " + field);

            try
            {
                TextUtils.PasteTo(field);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

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