Ejemplo n.º 1
0
            public void Should_throw_an_ImpossibleToPickTheLockException_when_the_lock_cannot_be_opened()
            {
                // Arrange
                var sut   = new PredefinedPicklock(new[] { "key2" });
                var @lock = new BasicLock("key1");

                // Act & Assert
                Assert.Throws <ImpossibleToPickTheLockException>(() => sut.Pick(@lock));
            }
Ejemplo n.º 2
0
            public void Should_unlock_the_specified_ILock(ILock @lock)
            {
                // Arrange
                Assert.True(@lock.IsLocked, "The lock should be locked.");
                var sut = new PredefinedPicklock(new[] { "key1", "key2", "key3" });

                // Act
                sut.Pick(@lock);

                // Assert
                Assert.False(@lock.IsLocked, "The lock should be unlocked.");
            }