Fixed a AdafruitShop test.
This commit is contained in:
parent
89955968bf
commit
1d35e8a838
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@ -11,7 +11,7 @@ pipeline {
|
||||
}
|
||||
stage("Test") {
|
||||
steps {
|
||||
dotnetTest project: "Props.Shop/Props.Shop.Tests.sln" unstableIfErrors: true, unstableIfWarnings: true
|
||||
dotnetTest project: "Props.Shop/Props.Shop.Tests.sln", unstableIfErrors: true, unstableIfWarnings: true
|
||||
}
|
||||
}
|
||||
stage("Publish") {
|
||||
@ -36,7 +36,7 @@ pipeline {
|
||||
}
|
||||
stage("Test") {
|
||||
steps {
|
||||
dotnetTest project: "Props.Tests" unstableIfErrors: true, unstableIfWarnings: true
|
||||
dotnetTest project: "Props.Tests", unstableIfErrors: true, unstableIfWarnings: true
|
||||
}
|
||||
}
|
||||
stage("Publish") {
|
||||
|
@ -8,9 +8,11 @@ namespace Props.Shop.Adafruit.Tests
|
||||
public class AdafruitShopTest
|
||||
{
|
||||
[Fact]
|
||||
public async void TestSearch() {
|
||||
public async void TestSearch()
|
||||
{
|
||||
AdafruitShop mockAdafruitShop = new AdafruitShop();
|
||||
await mockAdafruitShop.Initialize(null, LoggerFactory.Create(builder => {
|
||||
await mockAdafruitShop.Initialize(null, LoggerFactory.Create(builder =>
|
||||
{
|
||||
builder.AddXUnit();
|
||||
}));
|
||||
Assert.NotEmpty(mockAdafruitShop.Search("raspberry pi", new Filters()).ToEnumerable());
|
||||
|
@ -36,6 +36,7 @@ namespace Props.Shop.Adafruit
|
||||
);
|
||||
public async ValueTask Initialize(string workspaceDir, ILoggerFactory loggerFactory)
|
||||
{
|
||||
workspaceDir = workspaceDir ?? "";
|
||||
this.workspaceDir = workspaceDir;
|
||||
this.loggerFactory = loggerFactory;
|
||||
logger = loggerFactory.CreateLogger<AdafruitShop>();
|
||||
@ -105,7 +106,6 @@ namespace Props.Shop.Adafruit
|
||||
LiveProductListingManager productListingManager = new LiveProductListingManager(http, loggerFactory.CreateLogger<LiveProductListingManager>(), listingData, configuration.MinDownloadInterval);
|
||||
this.searchManager = new SearchManager(productListingManager, configuration.Similarity);
|
||||
productListingManager.StartUpdateTimer(delay: 0, configuration.CacheLifespan);
|
||||
|
||||
}
|
||||
|
||||
public async Task<ProductListing> GetProductFromIdentifier(string identifier)
|
||||
|
Loading…
Reference in New Issue
Block a user