Skip to content

jeduardocosta/desafio-dev

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Desafio Desenvolvedor

Desafio

Detalhamento

Continuous Delivery service

  • Build and tests

Build status

Libraries utilizadas

  • NancyFX - Lightweight, low-ceremony, framework for building HTTP based services
  • FluentAssertions - Fluent Assertions is a set of .NET extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style test
  • FluentValidation - A small validation library for .NET that uses a fluent interface and lambda expressions for building validation rules.
  • LightInject - An ultra lightweight IoC container
  • NUnit - Unit-testing framework for all .Net languages
  • RestSharp - Simple REST and HTTP API Client

Como utilizar?

Através do recurso "routes", realizar ação POST e informar lista de endereços e tipo da rota (shortest ou fastest) a ser calculada.

/routes

Exemplo de request

{
	"addresses": [{
		"street": "av paulista",
		"number": "1",
		"city": "sao paulo",
		"state": "sp"
	}, {
		"street": "av paulista",
		"number": "200",
		"city": "sp",
		"state": "sp"
	}],
	"type": "shortest"
}

Exemplo de response

Status code 200
{
	"data": [{
		"totalTime": 5646,
		"totalDistance": 76408,
		"fuelCost": 0,
		"totalCostWithToll": 0
	}],
	"errors": [],
	"success": true
}
Status code 422
{
  "data": [],
  "errors": [
    "street information should be informed",
    "entry state information is not valid"
  ],
  "success": false
}
Status code 500
{
  "data": [],
  "errors": [
    "an error occurred"
  ],
  "success": false
}

Próximos passos

  • Converter projeto para .NET Core
  • Construir imagem no Docker e assim disponibilizar um ambiente pronto para testes funcionais da aplicação

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%