コード例 #1
0
ファイル: HMDManagerTest.cs プロジェクト: staubhp/RiftDotNet
		public void TestDevicesPresent()
		{
			//
			// This test assumes that the device has already been attached when
			// the HMDManager is created and verifies that it correctly queries
			// them.
			//

			var debug = new Dummy.DeviceManager();
			var hmds = new[] {debug.CreateHMD(), debug.CreateHMD()};
			debug.SetHmds(hmds);
			using (var mgr = new HMDManager(new Dummy.Factory(), debug))
			{
				mgr.Devices.Count.Should().Be(2);
				mgr.Devices[0].Info.Should().BeSameAs(hmds[0].Info);
				mgr.Devices[1].Info.Should().BeSameAs(hmds[1].Info);

				var attached1 = mgr.AttachedDevice;
				var attached2 = mgr.WaitForAttachedDevice(null);
				attached1.Should().BeSameAs(attached2);
			}
		}
コード例 #2
0
        public void TestDevicesPresent()
        {
            //
            // This test assumes that the device has already been attached when
            // the HMDManager is created and verifies that it correctly queries
            // them.
            //

            var debug = new Dummy.DeviceManager();
            var hmds  = new[] { debug.CreateHMD(), debug.CreateHMD() };

            debug.SetHmds(hmds);
            using (var mgr = new HMDManager(new Dummy.Factory(), debug))
            {
                mgr.Devices.Count.Should().Be(2);
                mgr.Devices[0].Info.Should().BeSameAs(hmds[0].Info);
                mgr.Devices[1].Info.Should().BeSameAs(hmds[1].Info);

                var attached1 = mgr.AttachedDevice;
                var attached2 = mgr.WaitForAttachedDevice(null);
                attached1.Should().BeSameAs(attached2);
            }
        }