Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve bug in APIView #8177

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/dotnet/APIView/APIView/Analysis/Analyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public Analyzer()
_analyzers.Add(new ClientMethodsAnalyzer());
_analyzers.Add(new ClientConstructorAnalyzer());
_analyzers.Add(new ClientOptionsAnalyzer());
_analyzers.Add(new ClientAssemblyNamespaceAnalyzer());
_analyzers.Add(new BannedAssembliesAnalyzer());
_analyzers.Add(new TypeNameAnalyzer());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,28 @@ namespace APIViewIntegrationTests.RepositoryTests
{
public class CosmosPullRequestRepositoryTestsBaseFixture : IDisposable
{
private IConfigurationRoot _config;
private readonly CosmosClient _cosmosClient;
private readonly string _cosmosDBname;
public CosmosPullRequestsRepository PullRequestRepositopry { get; private set; }
public CosmosReviewRepository ReviewRepository { get; private set; }

public CosmosPullRequestRepositoryTestsBaseFixture()
{
var _config = new ConfigurationBuilder()
var config = new ConfigurationBuilder()
.AddEnvironmentVariables(prefix: "APIVIEW_")
.AddUserSecrets(typeof(TestsBaseFixture).Assembly)
.Build();

_cosmosDBname = "CosmosPullRequestRepositoryTestsDB";
_config["CosmosDBName"] = _cosmosDBname;
config["CosmosDBName"] = _cosmosDBname;

_cosmosClient = new CosmosClient(_config["Cosmos:ConnectionString"]);
var dataBaseResponse = _cosmosClient.CreateDatabaseIfNotExistsAsync(_config["CosmosDBName"]).Result;
_cosmosClient = new CosmosClient(config["Cosmos:ConnectionString"]);
var dataBaseResponse = _cosmosClient.CreateDatabaseIfNotExistsAsync(config["CosmosDBName"]).Result;
dataBaseResponse.Database.CreateContainerIfNotExistsAsync("Reviews", "/id").Wait();
dataBaseResponse.Database.CreateContainerIfNotExistsAsync("PullRequests", "/ReviewId").Wait();

ReviewRepository = new CosmosReviewRepository(_config, _cosmosClient);
PullRequestRepositopry = new CosmosPullRequestsRepository(_config, ReviewRepository, _cosmosClient);
ReviewRepository = new CosmosReviewRepository(config, _cosmosClient);
PullRequestRepositopry = new CosmosPullRequestsRepository(config, ReviewRepository, _cosmosClient);
PopulateDBWithDummyPullRequestData().Wait();
PopulateDBWithDummyReviewData().Wait();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,25 @@ namespace APIViewIntegrationTests.RepositoryTests
{
public class CosmosReviewRepositoryTestsBaseFixture : IDisposable
{
private IConfigurationRoot _config;
private readonly CosmosClient _cosmosClient;
private readonly string _cosmosDBname;
public CosmosReviewRepository ReviewRepository { get; private set; }

public CosmosReviewRepositoryTestsBaseFixture()
{
var _config = new ConfigurationBuilder()
var config = new ConfigurationBuilder()
.AddEnvironmentVariables(prefix: "APIVIEW_")
.AddUserSecrets(typeof(TestsBaseFixture).Assembly)
.Build();

_cosmosDBname = "CosmosReviewRepositoryTestsDB";
_config["CosmosDBName"] = _cosmosDBname;
config["CosmosDBName"] = _cosmosDBname;

_cosmosClient = new CosmosClient(_config["Cosmos:ConnectionString"]);
var dataBaseResponse = _cosmosClient.CreateDatabaseIfNotExistsAsync(_config["CosmosDBName"]).Result;
_cosmosClient = new CosmosClient(config["Cosmos:ConnectionString"]);
var dataBaseResponse = _cosmosClient.CreateDatabaseIfNotExistsAsync(config["CosmosDBName"]).Result;
dataBaseResponse.Database.CreateContainerIfNotExistsAsync("Reviews", "/id").Wait();

ReviewRepository = new CosmosReviewRepository(_config, _cosmosClient);
ReviewRepository = new CosmosReviewRepository(config, _cosmosClient);
PopulateDBWithDummyReviewData().Wait();
}

Expand Down