コード例 #1
0
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
 public static void GetMD5Hash()
 {
     SynchronizationContextWaiter.Execute(() =>
     {
         var services = new Mux.Platform.PlatformServices();
         Assert.AreEqual("d41d8cd98f00b204e9800998ecf8427e", services.GetMD5Hash(""));
     });
 }
コード例 #2
0
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
 public static void RuntimePlatform()
 {
     SynchronizationContextWaiter.Execute(() =>
     {
         var services = new Mux.Platform.PlatformServices();
         Assert.AreEqual("Unity", services.RuntimePlatform);
     });
 }
コード例 #3
0
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
 public static void CreateTicker()
 {
     SynchronizationContextWaiter.Execute(() =>
     {
         var services = new Mux.Platform.PlatformServices();
         var ticker   = services.CreateTicker();
         Assert.IsInstanceOf <Mux.Platform.Ticker>(ticker);
     });
 }
コード例 #4
0
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
        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
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
 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
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
        public static void GetUserStoreForApplication()
        {
            SynchronizationContextWaiter.Execute(() =>
            {
                var services = new Mux.Platform.PlatformServices();

                Assert.Throws <NotImplementedException>(
                    () => services.GetUserStoreForApplication());
            });
        }
コード例 #7
0
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
        public static void GetStreamAsync()
        {
            SynchronizationContextWaiter.Execute(() =>
            {
                var services = new Mux.Platform.PlatformServices();

                Assert.Throws <NotImplementedException>(
                    () => services.GetStreamAsync(null, new CancellationToken()));
            });
        }
コード例 #8
0
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
        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
ファイル: Device.cs プロジェクト: yakumo-proj/Mux
        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();
            });
        }