public void Use_of_custom_IKey_throws() { var key = new FakeKey(); Assert.Equal( CoreStrings.CustomMetadata(nameof(Use_of_custom_IKey_throws), nameof(IKey), nameof(FakeKey)), Assert.Throws <NotSupportedException>(() => key.AsKey()).Message); }
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); }