示例#1
0
        public void ApiKeyDataStoreTestSetup()
        {
            _apiKey = new ApiKey()
            {
                Id    = "Test1234",
                Token = "1328d3d1-c371-491c-932e-25767d7b85f6"
            };
            _apiKeyTest = new Entity()
            {
                ["Id"]    = _apiKey.Id,
                ["Token"] = _apiKey.Token,
            };
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json", optional: true)
                                .AddEnvironmentVariables()
                                .Build();

            _projectId = configuration["GOOGLE_CLOUD_PROJECT"] ?? configuration["Datastore:ProjectId"];

            _apiKeyDataStoreTest = new ApiKeyDataStore(configuration);
        }
 public ApiKeyService(IApiKeyDataStore context) => _context = context;