Skip to content

mdavid626/artemis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Artemis

Solution

As my time was very limited (4 hours) I was not able to implement all features. For example full unit tests coverage is missing.

Developer tools:

  • Visual Studio 2017
  • .NET 4.6
  • NuGet package manager
  • ASP.NET Web API 2
  • MSTest, NSubstitute, Effort
  • SQLite database, Entity Framework

Please edit the connectionstring in the web.config. You can use the sample database provided (artemis.db). Please make sure the web application has read/write access to the database file. For development purposes you can place the database file in your user folder. You can use the create.sql script from the Artemis.Data project to create the initial database structure.

The API is available on the URL: http://<server>/api/CarAdvert.

Sorting: use the orderBy and direction query parameters, e.g.: orderBy=Title&direction=desc. The supported values for orderBy are: Id, Title, Price and for the direction: asc or desc.

Requirements

Create a git repository (either local or public one on GitHub) that contains a RESTful web-service written in C#. The service should allow users to place new car adverts and view, modify and delete existing car adverts.

Car adverts should have the following fields:

  • id (required): int or guid, choose whatever is more convenient for you;
  • title (required): string, e.g. "Audi A4 Avant";
  • fuel (required): gasoline or diesel, use some type which could be extended in the future by adding additional fuel types;
  • price (required): integer;
  • new (required): boolean, indicates if car is new or used;
  • mileage (only for used cars): integer;
  • first registration (only for used cars): date without time.

Service should:

  • have functionality to return list of all car adverts;
    • optional sorting by any field specified by query parameter, default sorting - by id;
  • have functionality to return data for single car advert by id;
  • have functionality to add car advert;
  • have functionality to modify car advert by id;
  • have functionality to delete car advert by id;
  • have validation (see required fields and fields only for used cars);
  • accept and return data in JSON format, use standard JSON date format for the first registration field.

Additional requirements

  • Service should be able to handle CORS requests from any domain.
  • Think about test pyramid and write unit-, integration- and acceptance-tests if needed.
  • It's not necessary to document your code, but having a readme.md for developers who will potentially use your service would be great.

Tips, hints & insights

  • Feel free to use any C#/.NET version.

  • Feel free to make any assumptions as long as you can explain them.

  • Think how to use HTTP verbs and construct your HTTP paths to represent different actions (key word - RESTful).

  • Commit frequently, small commits will help us to understand how you tackle the problem.

  • We're using ASP.NET Web API at AutoScout24, but feel free to use a different framework of your choice.

  • Feel free to use any storage as long as we will be able to run it without doing excessive configuration work.

  • Feel free to ask questions! :)

Sending us your work

If you used GitHub repository, just send us a link to your repository.

If you used local repository, zip it (folder called ".git" in your working directory, it is hidden usually!) and send it us by email or put it on Dropbox and send us a link.

About

Scout24 interview task

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published