2021-08-07 22:20:46 +00:00
|
|
|
using System.Linq;
|
2021-08-05 06:22:19 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Props.Shop.Adafruit.Api;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Props.Shop.Adafruit.Tests.Api
|
|
|
|
{
|
|
|
|
public class SearchManagerTest
|
|
|
|
{
|
|
|
|
[Fact]
|
2021-08-07 22:20:46 +00:00
|
|
|
public void SearchTest()
|
2021-08-05 06:22:19 +00:00
|
|
|
{
|
|
|
|
FakeProductListingManager stubProductListingManager = new FakeProductListingManager();
|
|
|
|
SearchManager searchManager = new SearchManager(stubProductListingManager);
|
2021-08-07 22:20:46 +00:00
|
|
|
stubProductListingManager.RefreshProductListings();
|
2021-08-05 06:22:19 +00:00
|
|
|
searchManager.Similarity = 0.8f;
|
2021-08-07 22:20:46 +00:00
|
|
|
Assert.NotEmpty(searchManager.Search("Raspberry Pi").ToEnumerable());
|
2021-08-05 06:22:19 +00:00
|
|
|
searchManager.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|