|
|
@@ -59,12 +59,13 @@ namespace IvfTl.ControlHost.Tests.Fakes
|
|
|
|
|
|
public class FakeLease : IHardwareLease
|
|
|
{
|
|
|
+ private readonly FakeGate _gate;
|
|
|
public HardwareUser Owner { get; }
|
|
|
public ISerialChannel Serial { get; }
|
|
|
public ICamera Camera => null;
|
|
|
public bool Disposed;
|
|
|
- public FakeLease(ISerialChannel s, HardwareUser u) { Serial = s; Owner = u; }
|
|
|
- public void Dispose() => Disposed = true;
|
|
|
+ public FakeLease(FakeGate gate, ISerialChannel s, HardwareUser u) { _gate = gate; Serial = s; Owner = u; }
|
|
|
+ public void Dispose() { Disposed = true; _gate.ResumeCapture(); }
|
|
|
}
|
|
|
|
|
|
public class FakeGate : IHouseGate
|
|
|
@@ -83,7 +84,7 @@ namespace IvfTl.ControlHost.Tests.Fakes
|
|
|
{
|
|
|
if (!CanAcquire) return null;
|
|
|
IsCapturePaused = true;
|
|
|
- LastLease = new FakeLease(_serial, u);
|
|
|
+ LastLease = new FakeLease(this, _serial, u);
|
|
|
return LastLease;
|
|
|
}
|
|
|
public bool TryAcquire(HardwareUser u, out IHardwareLease l) { l = Acquire(u); return l != null; }
|