This is a collection of tests to verify basic programming knowledge in a variety of languages.
In the folder representing each language, there will be two files. One file provides unit tests. The other file is awaiting an implementation that will allow all of the tests to pass.
Here's a description of the class you must define:
- The class will be called
Person
. It's constructor will accept one argument:name
. - An instance of this class will offer a getter for the Person's name.
- An instance of this class will respond to a
greet
method that accepts one argument:message
. - When the message is
Hello
,greet
must returnHi, I'm {{name}}
. - When the message is
Goodbye
,greet
must returnBye
. - When the message is anything else,
greet
will return the message that it was provided.
Remember: Your implementation must meet the specifications of the provided test suite.
To run the tests, follow the instructions below for the language(s) of your choice.
As a convenience, you can also run the tests for each language using rake:
$ rake <language>
Open the solution in either Visual Studio or Xamarin Studio. You'll need to use NuGet to install NUnit.
To open the project in Eclipse:
- Open Eclipse and go to File > Import
- Choose General > Existing Projects into Workspace. Click Next.
- Click Browse and choose the folder from this project. Click Finish.
- You now be able to run the project.
Or you can use gradle:
$ gradle test -b java/build.gradle
Simply open javascript/index.html
in your browser.
Or, if you'd prefer to the tests using node:
npm install -g qunit
qunit -c javascript/person.js -t javascript/person_test.js
- Make sure to export Person.
Open objective-c/Person.xcodeproj
in Xcode.
Install PHPUnit. Execute phpunit php/PersonTest.php
Execute python python/person_test.py
.
Execute ruby ruby/person_test.rb
.
Open swift/Person.xcodeproj
in Xcode.
Create a private Github snippet and send me the url.