public IKey CreateMatchingKeyFor(ILock @lock) { var key = new FakeKey(); foreach (var signature in _signatures) { key.Signature = signature; if (@lock.DoesMatch(key)) { return(key); } } throw new ImpossibleToPickTheLockException(@lock); }
public void Pick(ILock @lock) { var key = new FakeKey(); foreach (var signature in _signatures) { key.Signature = signature; if (@lock.DoesMatch(key)) { @lock.Unlock(key); if ([email protected]) { return; } } } throw new ImpossibleToPickTheLockException(@lock); }