public virtual void TearDown() { Device.PlatformServices = null; DeviceDisplay.SetCurrent(null); System.Threading.Thread.CurrentThread.CurrentCulture = _defaultCulture; System.Threading.Thread.CurrentThread.CurrentUICulture = _defaultUICulture; DispatcherProvider.SetCurrent(null); }
public void Setting_Null_Is_Default() { DeviceDisplay.SetCurrent(new MyDisplay()); DeviceDisplay.SetCurrent(null); Assert.NotNull(DeviceDisplay.Current); Assert.Equal("DeviceDisplayImplementation", DeviceDisplay.Current.GetType().Name); }
public virtual void Setup() { _defaultCulture = System.Threading.Thread.CurrentThread.CurrentCulture; _defaultUICulture = System.Threading.Thread.CurrentThread.CurrentUICulture; Device.PlatformServices = new MockPlatformServices(); DispatcherProvider.SetCurrent(new DispatcherProviderStub()); DeviceDisplay.SetCurrent(null); }
public virtual void TearDown() { MockPlatformSizeService.Current?.Reset(); AppInfo.SetCurrent(null); DeviceDisplay.SetCurrent(null); DeviceInfo.SetCurrent(null); System.Threading.Thread.CurrentThread.CurrentCulture = _defaultCulture; System.Threading.Thread.CurrentThread.CurrentUICulture = _defaultUICulture; DispatcherProvider.SetCurrent(null); }
public virtual void Setup() { Microsoft.Maui.Controls.Hosting.CompatibilityCheck.UseCompatibility(); _defaultCulture = System.Threading.Thread.CurrentThread.CurrentCulture; _defaultUICulture = System.Threading.Thread.CurrentThread.CurrentUICulture; MockPlatformSizeService.Current?.Reset(); DispatcherProvider.SetCurrent(new DispatcherProviderStub()); DeviceDisplay.SetCurrent(null); DeviceInfo.SetCurrent(null); AppInfo.SetCurrent(null); }
public static DeviceDisplay[] GetActiveDevices() { DeviceDisplay[] deviceDisplayArray = new DeviceDisplay[1]; string str = NativeMethods.hackrf_board_id_name(1U); deviceDisplayArray[0] = new DeviceDisplay() { Index = 0U, Name = str }; return deviceDisplayArray; }
public static DeviceDisplay[] GetActiveDevices() { uint num = NativeMethods.rtlsdr_get_device_count(); DeviceDisplay[] array = new DeviceDisplay[num]; for (uint num2 = 0u; num2 < num; num2++) { string name = NativeMethods.rtlsdr_get_device_name(num2); array[num2] = new DeviceDisplay { Index = num2, Name = name }; } return(array); }
public void Setting_Custom_Invokes_Correct_Members() { var display = new MyDisplay(); DeviceDisplay.SetCurrent(display); Assert.Equal(0, display.StartedCount); Assert.Equal(0, display.StoppedCount); Assert.Equal(1, display.AddedCount); Assert.Equal(0, display.RemovedCount); Assert.Equal(0, display.SetKeepScreenOnCount); Assert.Equal(0, display.GetKeepScreenOnCount); Assert.Equal(1, display.GetMainDisplayInfoCount); Assert.False(display.KeepScreenOn); }
public static DeviceDisplay[] GetActiveDevices() { uint num = NativeMethods.sdriq_get_device_count(); DeviceDisplay[] array = new DeviceDisplay[num]; for (uint num2 = 0u; num2 < num; num2++) { string name = "SDR-IQ #" + num2 + " S/N: " + NativeMethods.sdriq_get_serial_number(num2); array[num2] = new DeviceDisplay { Index = num2, Name = name }; } return(array); }
public void MainDisplayInfo_Invokes_Correct_Members() { var expected = new DisplayInfo(100, 100, 2, DisplayOrientation.Portrait, DisplayRotation.Rotation0); var display = new MyDisplay(expected); DeviceDisplay.SetCurrent(display); display.ResetCounts(); var main = DeviceDisplay.MainDisplayInfo; Assert.Equal(expected, main); Assert.Equal(0, display.StartedCount); Assert.Equal(0, display.StoppedCount); Assert.Equal(0, display.AddedCount); Assert.Equal(0, display.RemovedCount); Assert.Equal(0, display.SetKeepScreenOnCount); Assert.Equal(0, display.GetKeepScreenOnCount); Assert.Equal(1, display.GetMainDisplayInfoCount); Assert.False(display.KeepScreenOn); }
public void Swapping_With_MainDisplayInfoChanged_Invokes_Correct_Members() { var onChangedInvokeCount = 0; var display1 = new MyDisplay(); var display2 = new MyDisplay(); DeviceDisplay.SetCurrent(display1); DeviceDisplay.MainDisplayInfoChanged += OnChanged; display1.ResetCounts(); DeviceDisplay.SetCurrent(display2); // old Assert.Equal(0, display1.StartedCount); Assert.Equal(1, display1.StoppedCount); Assert.Equal(0, display1.AddedCount); Assert.Equal(1, display1.RemovedCount); Assert.Equal(1, display1.GetKeepScreenOnCount); Assert.Equal(0, display1.GetMainDisplayInfoCount); Assert.Equal(0, onChangedInvokeCount); Assert.False(display1.KeepScreenOn); // new Assert.Equal(1, display2.StartedCount); Assert.Equal(0, display2.StoppedCount); Assert.Equal(1, display2.AddedCount); Assert.Equal(0, display2.RemovedCount); Assert.Equal(0, display2.SetKeepScreenOnCount); Assert.Equal(0, display2.GetKeepScreenOnCount); Assert.Equal(1, display2.GetMainDisplayInfoCount); Assert.Equal(0, onChangedInvokeCount); Assert.False(display2.KeepScreenOn); void OnChanged(object sender, DisplayInfoChangedEventArgs e) { onChangedInvokeCount++; } }
public override void Setup() { base.Setup(); Device.PlatformServices = new MockPlatformServices(); DeviceDisplay.SetCurrent(new MockDeviceDisplay()); }
public override void Setup() { base.Setup(); DeviceDisplay.SetCurrent(new MockDeviceDisplay()); }
public override void Setup() { base.Setup(); DeviceDisplay.SetCurrent(mockDeviceDisplay = new MockDeviceDisplay()); DeviceInfo.SetCurrent(mockDeviceInfo = new MockDeviceInfo()); }
public void Dispose() { DeviceDisplay.SetCurrent(null); }
public override void Setup() { base.Setup(); mockDeviceDisplay = new TestDeviceDisplay(); DeviceDisplay.SetCurrent(mockDeviceDisplay); }