- Visual Studio 2022 with .NET 8 Framework
- MongoDB
This project utilizes .NET Core and MongoDB for database operations. Follow the instructions below to set up your development environment.
-
Go to the MongoDB download page and choose the appropriate version for your operating system.
-
Follow the installation instructions for your operating system provided on the download page.
-
After installation, start the MongoDB service. On most systems, you can do this by running the
mongod
command in your terminal. -
Open a new terminal window and type
mongo
. If MongoDB is installed correctly, you will enter the MongoDB shell.
-
Open a terminal window and type
mongo
to enter the MongoDB shell. -
Inside the MongoDB shell, run the following command to create a database named SmartCharging:
use SmartCharging
- To verify that the database was created successfully, you can run the following command:
show dbs
Note: If you have problems with Mongo DB installation or if you want to install it by following the video, you can use the link below. MongoDB and MongoDB Compass visual interface installation is explained on this link.
After the database is installed, we can run our SmartCharging project from Visual Studio. When we run our project, you can access the Swagger UI interface from the link below.
You can access the Swagger UI json file from the link below.
xUnit and Postman were used for project RestApi tests.
We need to add the SmartCharging.Tests.csproj file in the SmartCharging.Tests folder to the SmartCharging project. For this, we need to right click on Solutions on SmartCharging in Visual Studio, select Add->Existing Project and add SmartCharging.Tests.csproj file to the project. Once we have included xUnit testing in our project, we can run the necessary tests. Note: Before running the tests, you should edit the dummy data in GroupTest.cs, ConnectorTest.cs and ChargeStationTest.cs files.
Postman Api tests were also used during project development. The related collection was shared as a json file. By importing this file into Postman, you can test the services and examine the parameters. In the link below, details about importing json file to collection are shared.