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 })); }
public void Teardown() { ThrowIfError(_client.RequestCameraConnection(new CameraConnectionRequest() { Command = ConnectionCommands.Disconnect })); ThrowIfError( _client.VimbaInstanceControl( new VimbaInstanceControlRequest() { Command = ConnectionCommands.Disconnect })); }
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); } }