Skip to content

kevin-mr/project-c

PROJECT C - API Integration Testing Tool

Welcome to the repository for PROJECT C. This guide will help you set up the project and run it locally on your machine.

Features

  • Create Mock Server endpoints to emulate a RESTful API behavior for testing during development.
  • Capture Webhook events to redirect them to local environments using our CLI tool.
  • Define variants of the simulated endpoints in the Mock Server to test multiple scenarios simultaneously.
  • Generate responses dynamically from temporal storage and previous request data

Prerequisites

Before you begin, make sure you have the following installed:

Getting Started

To get started with the project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/kevin-mr/project-c.git
    cd project-c
    
  2. Configure the Database:

  • Install and configure SQL Server or SQL Server Express if not already installed.
  • Create a new database [your_database_name].
  1. Database Connection Configuration:
  • Open the appsettings.json file in the ProjectC.Server project:
    {
      "ConnectionStrings": {
        "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Database=your_database_name;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False;User Id=your_user_id;password=your_password;"
      },
      // Other configurations...
    }
    
  • Replace your_database_name, your_user_id ,your_password, and any other necessary settings with your SQL Server configuration.
  1. Run Database Migrations:
  • Open a terminal or command prompt in the ProjectC.Server directory and run the following commands:

    dotnet ef database update
    
  • This command applies any pending migrations to the database.

  • If you have any problem running the migrations, check ef official docs

  1. Build and Run the Project:
  • Open the solution (ProjectName.sln) in Visual Studio or Visual Studio Code.
  • Restore the dependencies and build the solution.
  • Set ProjectC.Server as the startup project.
  • Press F5 or use the IDE's running/debugging feature to start the project.
  1. Access the Application:

Once the project is running, you can access the Blazor application in your web browser at:

  1. CLI Tool

To redirect webhook events to a local environment, follow these steps:

  • Publish Your Project to the Cloud: Utilize any cloud provider such as Azure that offers a public URL.

  • Run the CLI Project: Execute the CLI project and specify the server URL as a parameter.

    project-c --url [server_url]
    

Replace [server_url] with your actual server URL, e.g., https://localhost:7026.

  • Alternatively, Use the NuGet Package Version: If preferred, you can also use the NuGet package version of the project. The command remains the same.

Troubleshooting

If you encounter any issues while setting up or running the project, please check the following:

  • Ensure all prerequisites are installed correctly.
  • Verify database connection strings and configurations in appsettings.json.
  • Check for any build or runtime errors in Visual Studio or Visual Studio Code.

If your issue is not resolved, please submit an issue to the repository.

About

API Integration Testing Tool, create Mock Servers, capture Webhook events, define endpoint variants and generate responses dynamically.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors