KxCheckout is a supermarket checkout system implemented following TDD and using Elixir
Erlang and Elixir need to be installed, install them using brew or asdf
# Using brew
brew install erlang elixir
# Using asdf
# Install Erlang
asdf add plugin erlang
asdf install erlang latest
asdf global erlang latest
# Install Elixir
asdf add plugin elixir
asdf install elixir latest
asdf global elixir latest
# first clone the project
git clone https://github.com/tlarevo/KxCheckout.git
# update the deps
mix deps.get
# then run mix test
mix test
For tests check:
test/kx_checkout_test.exstest/kx_checkout/payment_calculator_test.exstest/kx_checkout/models/discount_rules/buy_x_get_y_test.extest/kx_checkout/models/discount_rules/buy_x_get_discount_test.ex
For logic implementation check:
lib/kx_checkout.exlib/kx_checkout/payment_calculator.exlib/kx_checkout/models/discount_rules/buy_x_get_y.exlib/kx_checkout/models/discount_rules/buy_x_get_discount.ex
Add following to mix.exs under deps
def deps do
[
{:kx_checkout, git: "https://github.com/tlarevo/KxCheckout.git", brance: :master}
]
end