Пример #1
0
 public static void GetMD5Hash()
 {
     SynchronizationContextWaiter.Execute(() =>
     {
         var services = new Mux.Platform.PlatformServices();
         Assert.AreEqual("d41d8cd98f00b204e9800998ecf8427e", services.GetMD5Hash(""));
     });
 }
Пример #2
0
 public static void RuntimePlatform()
 {
     SynchronizationContextWaiter.Execute(() =>
     {
         var services = new Mux.Platform.PlatformServices();
         Assert.AreEqual("Unity", services.RuntimePlatform);
     });
 }
Пример #3
0
 public static void CreateTicker()
 {
     SynchronizationContextWaiter.Execute(() =>
     {
         var services = new Mux.Platform.PlatformServices();
         var ticker   = services.CreateTicker();
         Assert.IsInstanceOf <Mux.Platform.Ticker>(ticker);
     });
 }
Пример #4
0
        public static void GetNamedSize()
        {
            SynchronizationContextWaiter.Execute(() =>
            {
                var services = new Mux.Platform.PlatformServices();

                Assert.Throws <NotImplementedException>(
                    () => services.GetNamedSize(new Xamarin.Forms.NamedSize(), null, false));
            });
        }
Пример #5
0
 public static void GetAssemblies()
 {
     SynchronizationContextWaiter.Execute(() =>
     {
         var services = new Mux.Platform.PlatformServices();
         var expected = System.AppDomain.CurrentDomain.GetAssemblies();
         var result   = services.GetAssemblies();
         Assert.AreEqual(expected, result);
     });
 }
Пример #6
0
        public static void GetUserStoreForApplication()
        {
            SynchronizationContextWaiter.Execute(() =>
            {
                var services = new Mux.Platform.PlatformServices();

                Assert.Throws <NotImplementedException>(
                    () => services.GetUserStoreForApplication());
            });
        }
Пример #7
0
        public static void GetStreamAsync()
        {
            SynchronizationContextWaiter.Execute(() =>
            {
                var services = new Mux.Platform.PlatformServices();

                Assert.Throws <NotImplementedException>(
                    () => services.GetStreamAsync(null, new CancellationToken()));
            });
        }
Пример #8
0
        public static void BeginInvokeOnMainThread()
        {
            SynchronizationContext context = null;

            SynchronizationContextWaiter.Execute(() =>
            {
                var services = new Mux.Platform.PlatformServices();

                services.BeginInvokeOnMainThread(
                    () => context = SynchronizationContext.Current);
            });

            Assert.AreEqual(Mux.Forms.mainThread, context);
        }
Пример #9
0
        public static void StartTimer()
        {
            SynchronizationContextWaiter.Execute(() =>
            {
                var services = new Mux.Platform.PlatformServices();
                var done     = new ManualResetEvent(false);
                var thread   = new Thread(() => services.StartTimer(new TimeSpan(2), () =>
                {
                    done.Set();
                    return(false);
                }));

                thread.Start();
                done.WaitOne();
            });
        }