public void AreItemsInCategory_EmptyProduct_Failed() { // Arrange var context = new AssociationExpressionEvaluationContext() { Products = new[] { new CatalogProduct { }, } }; var categoryIds = new string[] { "noMatches" }; // Act var result = context.AreItemsInCategory(categoryIds); // Assert Assert.False(result); }
public void AreItemsInCategory_MatchesCategoryId_Succeeded() { // Arrange var context = new AssociationExpressionEvaluationContext() { Products = new[] { new CatalogProduct { CategoryId = "cat1", } } }; var categoryIds = new string[] { "cat1" }; // Act var result = context.AreItemsInCategory(categoryIds); // Assert Assert.True(result); }
public void AreItemsInCategory_NotMatchingOutline_Failed() { // Arrange var context = new AssociationExpressionEvaluationContext() { Products = new[] { new CatalogProduct { Outlines = new [] { new Outline() { Items = new [] { new OutlineItem() { Id = "outerCat" }, new OutlineItem() { Id = "innerCat" }, }, } }, }, } }; var categoryIds = new string[] { "noMatches" }; // Act var result = context.AreItemsInCategory(categoryIds); // Assert Assert.False(result); }