Skip to content

Exercise 3 of Transport Tycoon Exercises for DDD

Notifications You must be signed in to change notification settings

digimortl/tycoon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transport Tycoon Exercises for DDD solution (https://github.com/Softwarepark/exercises/blob/master/transport-tycoon.md)

The idea to make use of this approach was brought from Smalltalk "Bluebook"
(http://wiki.squeak.org/squeak/64) -- event-driven simulations. Sorry me for my PEP8!
I violated it intentionally for the sake of respect of this great language.

First usecase (Exercise 1)

A -> 5 hours
AB -> 5 hours
BB -> 5 hours
ABB -> 7 hours
AABABBAB - > 29 hours
ABBBABAAABBB -> 41 hours

Second usecase (Exercise 2)

ABBBABAAABBB -> 39 hours

See ./traces directory to investigate domain events.

How to build/run:

GOROOT=/path/to/sdk/go1.13.5
GOPATH=/path/to/workspace
${GOROOT}/go build -o ${GOPATH}/bin/tycoon
${GOPATH}/bin/tycoon exercise-2 ABBBABAAABBB

How to test:

GOROOT=/path/to/sdk/go1.13.5
GOPATH=/path/to/workspace
${GOROOT}/go test -c -o /tmp/usecase_test_go github.com/digimortl/tycoon
${GOROOT}/go tool test2json -t /tmp/usecase_test_go -test.v -test.run "^TestUseCase1|TestUseCase2$"