예제 #1
0
        public async Task CreateAndStoreNewKeyAsync_should_create_and_store_and_return_key()
        {
            var result = await _subject.CreateAndStoreNewKeyAsync();

            _mockKeyProtector.ProtectWasCalled.Should().BeTrue();
            _mockKeyStore.Keys.Count.Should().Be(1);
            _mockKeyStore.Keys.Single().Id.Should().Be(result.Id);
            result.Created.Should().Be(_mockClock.UtcNow.DateTime);
        }