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