Giter Site home page Giter Site logo

roadstatus's Introduction

Road Status

What is Road Status

A console application that retrieves the status of any road that is managed by TfL (backed by their Road endpoint).

Prerequisites

All the commands detailed below are ran via Powershell 7.1.5.

Building and running the application

Before running the application or tests you need an app key which has access to TfL's Road api. Once you have this you must configure the AppKey via a machine level environment variable or enter it into the appsettings.json file.

You can add the system level environment variable via system properties however the simplest way of setting the environment variable is via setx command as follows via powershell: setx TfLApiConfig__AppKey "YOUR_API_KEY" /M

To remove this variable run (as admin): REG delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /F /V TfLApiConfig__AppKey

Build the solution:

dotnet build .\RoadStatus.sln

Run the solution:

dotnet run --project .\src\RoadStatus.Console\RoadStatus.Console.csproj a1 or .\src\RoadStatus.Console\bin\Debug\net5.0\RoadStatus.Console.exe a1

dotnet run --project .\src\RoadStatus.Console\RoadStatus.Console.csproj a99 or .\src\RoadStatus.Console\bin\Debug\net5.0\RoadStatus.Console.exe a99

dotnet run --project .\src\RoadStatus.Console\RoadStatus.Console.csproj or .\src\RoadStatus.Console\bin\Debug\net5.0\RoadStatus.Console.exe

dotnet run --project .\src\RoadStatus.Console\RoadStatus.Console.csproj " " or .\src\RoadStatus.Console\bin\Debug\net5.0\RoadStatus.Console.exe " "

Running the tests

Before running the tests you need an app key which has access to TfL's Road api. Once you have this you must configure the AppKey via a secrets.json file as follows

Run the following commands while at the root of the repo: dotnet user-secrets init --project .\tests\RoadStatus.EndToEndTests\RoadStatus.EndToEndTests.csproj

dotnet user-secrets set "TfLApiConfig:AppKey" "YOUR_API_KEY" --project .\tests\RoadStatus.EndToEndTests\RoadStatus.EndToEndTests.csproj

You can confirm these have been set successfully via dotnet user-secrets set "TfLApiConfig:AppKey" "faeb9e1b43214fde95500b1a7563170e" --project .\tests\RoadStatus.EndToEndTests\RoadStatus.EndToEndTests.csproj

Using the .NET cli: dotnet test .\tests\RoadStatus.EndToEndTests\RoadStatus.EndToEndTests.csproj dotnet test .\tests\RoadStatus.UnitTests\RoadStatus.UnitTests.csproj

To remove user secrets run the following: dotnet user-secrets clear --project .\tests\RoadStatus.EndToEndTests\RoadStatus.EndToEndTests.csproj

The dotnet user-secrets have been available since .net core 2.1.

Code Metrics

roadstatus's People

Contributors

asos-edonisseferi avatar

Watchers

 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.