Giter VIP home page Giter VIP logo

programming-tests's Introduction

Programming Test

This is a collection of tests to verify basic programming knowledge in a variety of languages.

Instructions

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 return Hi, I'm {{name}}.
  • When the message is Goodbye, greet must return Bye.
  • 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.

Running tests

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>

C#

Open the solution in either Visual Studio or Xamarin Studio. You'll need to use NuGet to install NUnit.

Java / Scala

To open the project in Eclipse:

  1. Open Eclipse and go to File > Import
  2. Choose General > Existing Projects into Workspace. Click Next.
  3. Click Browse and choose the folder from this project. Click Finish.
  4. You now be able to run the project.

Or you can use gradle:

$ gradle test -b java/build.gradle

Javascript

Simply open javascript/index.html in your browser.

Or, if you'd prefer to the tests using node:

  1. npm install -g qunit
  2. qunit -c javascript/person.js -t javascript/person_test.js
  3. Make sure to export Person.

Objective C

Open objective-c/Person.xcodeproj in Xcode.

PHP

Install PHPUnit. Execute phpunit php/PersonTest.php

Python

Execute python python/person_test.py.

Ruby

Execute ruby ruby/person_test.rb.

Swift

Open swift/Person.xcodeproj in Xcode.

Submission

Create a private Github snippet and send me the url.

programming-tests's People

Contributors

rzane avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.