Code Monkey home page Code Monkey logo

rvezywebapi's Introduction

RVezyWebAPI

Tech Stack

  • Visual Studio 2019
  • .NET Core 5.0
  • EF Core 6
  • SQl Server
  • AutoMapper
  • xUnit
  • Serilog
  • CsvHelper
  • Swashbuckle
  • FluentAssertions
  • Moq

Solution

solution

The solution contains 5 projects:

  • 0 - Common/RVezy.Common.DI: dependency injection.
  • 1 - Presentation/RVezy.Presentation.WebAPI: controllers.
  • 2 - Domain/RVezy.Domain.Domain: intermediate entities, interfaces and models.
  • 3 - Infra/RVezy.Infra.Infra: database entities and repositories.
  • 4 - Tests/RVezy.Tests: unity tests and CSV files.

Web API

swagger

  • In order to run the web API, a SQL Server connection string must be set in the appsettings.json file:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server={SERVER},{PORT};Database={DATABASE};User Id={USER_ID};Password={PASSWORD};"
  },
  ...
}
  • The database will be created through migration once the web API runs, but the data will be inserted only after the CSV files be uploaded on the Swagger page.
  • The CSV files are located at: "4 - Tests\RVezy.Tests\Files".
  • Each file has its own endpoint:
    • "listings.csv": POST ​/Listing​/upload
    • "calendars.csv": POST ​/Calendar/upload
    • "reviews.csv": POST ​/Review/upload
  • The "listings.csv" file must be the first one to be uploaded.
  • The data extracted from the files will be displayed through the GET endpoints.

Unit Tests

tests

  • No configuration is needed before running the tests (neither a SQL Server connection).
  • There are 3 scenarios tested for each entity:
    • GET endpoints from controllers with mocked repositories;
    • Queries from repositories with In-Memory Database;
    • POST endpoints from controllers with CSV files uploaded dynamically.

rvezywebapi's People

Contributors

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