props/test/MultiShop.Shop/BanggoodModule.Tests/ShopTest.cs
Harrison Deng 6c684372df Changed to hosted blazorwasm project.
Restructured project following changes.

Moved shop assembly fetching to public facing Web API.
2021-05-21 13:32:25 -05:00

36 lines
933 B
C#

using MultiShop.Shop.Framework;
using SimpleLogger;
using Xunit;
using Xunit.Abstractions;
namespace MultiShop.Shop.BanggoodModule.Tests
{
public class ShopTest
{
public ShopTest(ITestOutputHelper output)
{
Logger.AddLogListener(new XUnitLogger(output));
}
[Fact]
public async void Search_CAD_ResultsFound()
{
//Given
const int MAX_RESULTS = 100;
Shop shop = new Shop();
shop.UseProxy = false;
//When
shop.Initialize();
shop.SetupSession("samsung galaxy 20 case", Currency.CAD);
//Then
int count = 0;
await foreach (ProductListing listing in shop)
{
count += 1;
Assert.False(string.IsNullOrWhiteSpace(listing.Name));
if (count >= MAX_RESULTS) return;
}
}
}
}