Made progress on implementing some shops.

Performed some folder restructuring as well.
This commit is contained in:
2021-07-20 17:51:43 -05:00
parent 56544938ac
commit e0756e0967
124 changed files with 159976 additions and 940 deletions

View File

@@ -0,0 +1,17 @@
using System;
using System.IO;
using Props.Shop.Adafruit.Api;
using Xunit;
namespace Props.Shop.Adafruit.Tests
{
public class ListingParserTest
{
[Fact]
public void TestParsing()
{
ListingsParser mockParser = new ListingsParser(File.ReadAllText("./Assets/products.json"));
Assert.NotEmpty(mockParser.ProductListings);
}
}
}

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Props.Shop.Adafruit.Api;
using Props.Shop.Framework;
using Xunit;
namespace Props.Shop.Adafruit.Tests.Api
{
public class ProductListingManagerTest
{
[Fact]
public async Task TestSearch()
{
ProductListingManager mockProductListingManager = new ProductListingManager();
mockProductListingManager.SetListings(File.ReadAllText("./Assets/products.json"));
List<ProductListing> results = new List<ProductListing>();
await foreach (ProductListing item in mockProductListingManager.Search("arduino", 0.5f))
{
results.Add(item);
}
Assert.NotEmpty(results);
}
}
}