-
-
Save shankardevy/d658c5f49c5d1dea3b1267e92baf64b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mango.CatalogTest do | |
use ExUnit.Case | |
alias Mango.Catalog | |
alias Mango.Catalog.Product | |
test "list_products/0 returns all products" do | |
[p1 = %Product{}, p2 = %Product{}] = Catalog.list_products | |
assert p1.name == "Tomato" | |
assert p2.name == "Apple" | |
end | |
test "list_seasonal_products/0 return all seasonal products" do | |
[product = %Product{}] = Catalog.list_seasonal_products | |
assert product.name == "Apple" | |
end | |
test "get_category_products/1 returns products of the given category" do | |
[product = %Product{}] = Catalog.get_category_products("fruits") | |
assert product.name == "Apple" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment