Created
January 31, 2019 06:08
-
-
Save nest-don/f6bd9fa1aacc5c57adba66f62d62cc3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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