Made progress on implementing some shops.
Performed some folder restructuring as well.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user