public void CanLocateSpecificDrinkByName() { var cabinet = new DrinksCabinet( recipes ); var expected = new LocalDrink( "a", "", new[] { new Ingredient( "1", Measurement.Tsp, 1 ) } ); var error = new LocalDrink( "b", "", new[] { new Ingredient( "2", Measurement.Tsp, 1 ) } ); recipes.Add( expected, error ); var result = cabinet.Find( expected.Name ); Assert.AreEqual( expected, result ); }
public void CanFilterDrinksOnNotSpecified() { var cabinet = new DrinksCabinet( recipes ); var expected = new LocalDrink( "a", "", new[] { new Ingredient( "1", Measurement.Tsp, 1 ) } ); var error = new LocalDrink( "b", "", new[] { new Ingredient( "2", Measurement.Tsp, 1 ) } ); recipes.Add( expected, error ); var results = cabinet.NotContaining( "2" ); Assert.AreEqual( expected, results.Single() ); }
public void FilteredDrinksContainsResultsWithAnyIngredientMatch() { var expected = new LocalDrink( "1", "", new[] { new Ingredient( "a", Measurement.Tsp, 1 ), new Ingredient( "b", Measurement.Tsp, 2 ) } ); recipes.Add( expected ); var results = recipes.WithIngredients( "b", "c" ); Assert.IsTrue( expected.Equals( results.Single() ) ); }
public void FilteredDrinksContainsOnlyThoseWithSpecifiedIngredients() { var expected = new LocalDrink( "1", "", new[] { new Ingredient( "a", Measurement.Tsp, 1 ) } ); var error = new LocalDrink( "2", "", new[] { new Ingredient( "b", Measurement.Tsp, 1 ) } ); recipes.Add( expected, error ); var results = recipes.WithIngredients( "a" ); Assert.AreEqual( expected, results.Single() ); }