public static void GetMD5Hash() { SynchronizationContextWaiter.Execute(() => { var services = new Mux.Platform.PlatformServices(); Assert.AreEqual("d41d8cd98f00b204e9800998ecf8427e", services.GetMD5Hash("")); }); }
public static void RuntimePlatform() { SynchronizationContextWaiter.Execute(() => { var services = new Mux.Platform.PlatformServices(); Assert.AreEqual("Unity", services.RuntimePlatform); }); }
public static void CreateTicker() { SynchronizationContextWaiter.Execute(() => { var services = new Mux.Platform.PlatformServices(); var ticker = services.CreateTicker(); Assert.IsInstanceOf <Mux.Platform.Ticker>(ticker); }); }
public static void GetNamedSize() { SynchronizationContextWaiter.Execute(() => { var services = new Mux.Platform.PlatformServices(); Assert.Throws <NotImplementedException>( () => services.GetNamedSize(new Xamarin.Forms.NamedSize(), null, false)); }); }
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); }); }
public static void GetUserStoreForApplication() { SynchronizationContextWaiter.Execute(() => { var services = new Mux.Platform.PlatformServices(); Assert.Throws <NotImplementedException>( () => services.GetUserStoreForApplication()); }); }
public static void GetStreamAsync() { SynchronizationContextWaiter.Execute(() => { var services = new Mux.Platform.PlatformServices(); Assert.Throws <NotImplementedException>( () => services.GetStreamAsync(null, new CancellationToken())); }); }
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); }
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(); }); }