Giter Club home page Giter Club logo

weatherforecast's Introduction

weatherforecast

Prerequisites

  • .Net Framework version 7.0

How to build, run and test

Build

in the terminal go to ~/cli/WeatherForecast.CLI/ directory and run below command

dotnet build

Run the app

Running the app with following command will give the help screen with options.

dotnet run

Options

Short form Long form Description
-d --days Required. Number of days to get data for
-l --latitude Required. GPS Latitude
-L --longitude Required. GPS Longitude

sample usage
dotnet run -d 2 -l 52.52 -L 13.41

sample successful message

Getting Weather Forecast summary for 2 day/s at Latitude: 52.52 and Longitude: 13.41
Successfully exported Weather Forecast to the file: ./output/weatherExport_20230502.json

Exported JSON file & Logs

  • The output file will be stored under ~/cli/WeatherForecast.CLI/output directory
  • Log files will be stored under ~/cli/logs directory


Test Plan / Requirements

  • Latitude is required
  • Longitude is required
  • Latitude should be a floating point number between -90 and +90
  • Longitude should be a floating point number between -180 and +180
  • Should return formatted data on success
  • Should return forecast for the specified number of days
  • Should calculate lowest and highest temperatures, snowfall correctly
  • Should calculate temperatures in Fahrenheit correctly
  • Should have the correct naming convention for the JSON file
  • Should fail with correct error message on internal server error
  • Should return appropriate error message on bad request

Assumptions

  • Number of days (d) are required and must be between 1 and 16 ( 1<= d <= 16)
  • Total snowfall for a day is equal to the sum of preceding hour forecast.

Formulas

formula to convert temperature from Celcius to Fahrenheit

(0°C × 1.8) + 32 = 32°F

weatherforecast's People

Contributors

dinindu 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.