Skip to content

Instantly share code, notes, and snippets.

@rhwy
Created January 21, 2020 08:49
Show Gist options
  • Save rhwy/7970798b6bd4969eb3f95abbf222fe38 to your computer and use it in GitHub Desktop.
Save rhwy/7970798b6bd4969eb3f95abbf222fe38 to your computer and use it in GitHub Desktop.

You'll have to create a Smart Hello World.

Your app need to take a name (by default world if none is provided) and write a greeting depending on the time of the day:

  • Good morning X if current hour is < 12h00
  • Good afternoon X if current hour is > 12h00 and < 20h00
  • Good night Xif current hour is after 20h00 and before 6h00 in the morning

You need to make it right:

  • take care of the boundaries of the system (what are your functional code and your technical code, what are invariants,...)
  • your business code should be testable
# how to create a solution with app and tests from command line
mkdir SmartHelloWorld
cd SmartHelloWorld
mkdir App
mkdir Tests
dotnet new console -o App/
dotnet new xunit -o Tests/
dotnet new sln
dotnet sln add App/App.csproj
dotnet sln add Tests/Tests.csproj
dotnet add Tests/Tests.csproj reference App/App.csproj
dotnet build #ensure the build of the solution is ok
dotnet run --project App/App.csproj #ensure the build of your app is ok
dotnet test Tests/Tests.csproj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment