Esempio n. 1
0
        public void SetNativeTextMultTest()
        {
            const string txt = @"“We’ve been here”";

            using var cb = new Clipboard();
            cb.SetText(txt, html);
        }
Esempio n. 2
0
 public void GetNativeTextTest()
 {
     using var cb = new Clipboard();
     foreach (TextDataFormat e in Enum.GetValues(typeof(TextDataFormat)))
     {
         TestContext.WriteLine($"{e}: {cb.GetText(e)}");
     }
 }
Esempio n. 3
0
 public void SetNativeTextHtmlTest()
 {
     using (var cb = new Clipboard())
         cb.SetText(html, TextDataFormat.Html);
     using (var cb = new Clipboard())
     {
         var outVal = cb.GetText(TextDataFormat.Html);
         Assert.That(outVal, Is.EqualTo(html));
     }
 }
Esempio n. 4
0
        public void EnumFormatsTest()
        {
            using var cb = new Clipboard();
            var fmts = cb.EnumAvailableFormats();

            Assert.That(fmts, Is.Not.Empty);
            TestContext.Write(string.Join(", ", fmts.Select(f => Clipboard.GetFormatName(f))));

            var fmt = fmts.First();

            Assert.IsTrue(Clipboard.IsFormatAvailable(fmt));
        }
Esempio n. 5
0
        public void GetPriorityFormatTest()
        {
            var fmts = Clipboard.CurrentlySupportedFormats.Select(f => f.Id).ToArray();

            Assert.That(Clipboard.GetFirstFormatAvailable(fmts), Is.GreaterThan(0));
        }