waelouf / RanodmVuePractice

0 stars 0 forks source link

Add unit tests for WeatherService class #3

Closed sweep-ai[bot] closed 1 year ago

sweep-ai[bot] commented 1 year ago

Description

This PR adds unit tests for the WeatherService class in the WeatherAppWebApi project. The unit tests ensure the functionality of the WeatherService class and improve the overall code quality and maintainability.

Summary

Please review and merge these changes to improve the test coverage and reliability of the WeatherApp application.

Fixes #1.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/add-unit-tests

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

sweep-ai[bot] commented 1 year ago

GitHub actions yielded the following error.

The command that failed is dotnet restore. Here are the relevant lines from the logs:

/home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherAppWebApi.Tests/WeatherAppWebApi.Tests.csproj : error NU1201: Project WeatherAppWebApi is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Project WeatherAppWebApi supports: net7.0 (.NETCoreApp,Version=v7.0) [/home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherApp.sln]
Failed to restore /home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherAppWebApi.Tests/WeatherAppWebApi.Tests.csproj (in 5.13 sec).

This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.

sweep-ai[bot] commented 1 year ago

GitHub actions yielded the following error.

The command that failed is dotnet build --no-restore WeatherApp.sln. Here are the relevant lines from the logs:

##[error]/home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherAppWebApi.Tests/WeatherServiceTests.cs(16,54): error CS0246: The type or namespace name 'MockConfigurationManager' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherAppWebApi.Tests/WeatherAppWebApi.Tests.csproj]
##[error]/home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherAppWebApi.Tests/WeatherServiceTests.cs(27,13): error CS0246: The type or namespace name 'Result<>' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherAppWebApi.Tests/WeatherAppWebApi.Tests.csproj]
##[error]/home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherAppWebApi.Tests/WeatherServiceTests.cs(44,13): error CS0246: The type or namespace name 'Result<>' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/RanodmVuePractice/RanodmVuePractice/WeatherApp/Backend/WeatherApp/WeatherAppWebApi.Tests/WeatherAppWebApi.Tests.csproj]

Please note that the lines have been wrapped in ``` for better readability.

This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.