public void Failure_NotMatchingKeywords() { ProductSearchResults?results = MarketBridge.SearchProducts(new ProductSearchCreteria("suabjkbeio")); Assert.NotNull(results, "Products search - null results"); Assert.IsEmpty(results, "Products search - not matching keywords - expected no results"); }
// Not a test case for now public void Failure_Typo() { ProductSearchResults?results = MarketBridge.SearchProducts(new ProductSearchCreteria("abg")); Assert.NotNull(results, "Products search - null results"); Assert.IsEmpty(results, "Products search - not matching keywords - expected no results"); Assert.AreEqual(results !.TypoFixes, "bag", "Product search - typo - expected fix"); }
public void Failure_MatchingKeywordsButNotFilter() { ProductSearchResults?results = MarketBridge.SearchProducts(new ProductSearchCreteria("charger") { PriceRange_High = 1 }); Assert.NotNull(results, "Products search - null results"); Assert.IsEmpty(results, "Products search - not matching filter - expected no results"); }
private void TestSuccess(ProductSearchCreteria searchCreteria, IEnumerable <ProductIdentifiable> expectedResults) { ProductSearchResults?results = MarketBridge.SearchProducts(searchCreteria); Assert.IsNotNull(results); Assert.IsNull(results !.TypoFixes, $"expected no typo fixes"); Assert.IsTrue(results !.IsValid(), $"expect valid results (valid IDs)"); new Assert_SetEquals <ProductIdentifiable> ( expectedResults, ProductIdentifiable.DeepEquals ).AssertEquals(results); }