Exemplo n.º 1
0
        public async Task Execute_CallExecuteWithNull_ThrowsArgumentNullException()
        {
            // Arrange
            var apiKey      = Guid.NewGuid().ToString();
            var apiKeyStore = new ApiKeysStore(apiKey);

            // Act
            // Assert
            await Assert.ThrowsAsync <ArgumentNullException>(async() => await apiKeyStore.Execute(null));
        }
Exemplo n.º 2
0
        public async Task Execute_FetchInternalKey_ReturnsPass()
        {
            // Arrange
            var apiKey      = Guid.NewGuid().ToString();
            var apiKeyStore = new ApiKeysStore(apiKey);

            // Act
            ApiKey resultingApiKey = await apiKeyStore.Execute(apiKey);

            // Assert
            Assert.Equal("Internal", resultingApiKey.Name);
            Assert.Equal(apiKey, resultingApiKey.Key);
        }