Skip to content

Instantly share code, notes, and snippets.

@nest-don
Created January 31, 2019 06:08
Show Gist options
  • Save nest-don/f6bd9fa1aacc5c57adba66f62d62cc3f to your computer and use it in GitHub Desktop.
Save nest-don/f6bd9fa1aacc5c57adba66f62d62cc3f to your computer and use it in GitHub Desktop.
public class UnitTests
{
[Fact]
public async void TestSearchAsync()
{
/*
Perform a search and return results
*/
// Arrange
var runtime = new Runtime(
QueueMode.Server | QueueMode.Client,
180, Enviorenment.Development
);
var serviceProvider = new ServiceCollection()
.AddLogging()
.BuildServiceProvider();
var factory = serviceProvider.GetService<ILoggerFactory>();
var logger = factory.CreateLogger<BitbucketRepository>();
BitbucketRepository repo = new BitbucketRepository(
runtime, logger);
// Act
SearchQuery query = new SearchQuery{
Text = "docker",
MaxResults = 100
};
SearchResult result = await repo.SearchAsync(query);
// Assert
Assert.NotNull(result);
Assert.NotNull(result.Data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment