Пример #1
0
        public void Setup()
        {
            _channel = new Channel("localhost:39946", ChannelCredentials.Insecure);
            _client  = new VimbaCamera.VimbaCameraClient(_channel);

            ThrowIfError(
                _client.VimbaInstanceControl(new VimbaInstanceControlRequest()
            {
                Command = ConnectionCommands.Connect
            }));
            ThrowIfError(_client.RequestCameraConnection(new CameraConnectionRequest()
            {
                Command  = ConnectionCommands.Connect,
                CameraID = TestClass.CameraId
            }));

            ThrowIfError(_client.RequestReset(new ResetRequest()));

            Task.Delay(1000).Wait();

            ThrowIfError(_client.RequestCameraConnection(new CameraConnectionRequest()
            {
                Command  = ConnectionCommands.Connect,
                CameraID = TestClass.CameraId
            }));
        }
Пример #2
0
 public void Teardown()
 {
     ThrowIfError(_client.RequestCameraConnection(new CameraConnectionRequest()
     {
         Command = ConnectionCommands.Disconnect
     }));
     ThrowIfError(
         _client.VimbaInstanceControl(
             new VimbaInstanceControlRequest()
     {
         Command = ConnectionCommands.Disconnect
     }));
 }
Пример #3
0
 public void StartVimbaAndShutDown(InsertRunnable runnable = null)
 {
     {
         var response =
             _client.VimbaInstanceControl(
                 new VimbaInstanceControlRequest()
         {
             Command = ConnectionCommands.Connect
         });
         Assert.IsNull(response.Error);
         Assert.IsTrue(response.IsStarted);
     }
     runnable?.Invoke();
     {
         var response =
             _client.VimbaInstanceControl(
                 new VimbaInstanceControlRequest()
         {
             Command = ConnectionCommands.Disconnect
         });
         Assert.IsNull(response.Error);
         Assert.IsFalse(response.IsStarted);
     }
 }