Skip to content

Commit

Permalink
Add new projects and update solution configuration
Browse files Browse the repository at this point in the history
- Updated `Restaurants.sln` to include new projects and configurations.
- Added `src\Resturants.csproj` and `Resturant.Tests\Resturant.Tests.csproj`.
- Updated `GlobalSection(ProjectConfigurationPlatforms)` for new test project.
- Re-added `GlobalSection(SolutionProperties)` to show solution node.
- Renamed parameter in `Program.cs` for MediatR service registration.
- Removed and re-added `Restaurants.csproj` with the same content.
- Added `EndpointTest` class in `Resturant.Tests` namespace.
- Created `Resturant.Tests.csproj` with necessary settings and references.
- Added `Resturants.csproj` with required settings and package references.
  • Loading branch information
nahiandev committed Dec 30, 2024
1 parent b9a4fcd commit 8bab7dc
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Restaurants.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Restaurants", "src\Restaurants.csproj", "{F74660A2-2891-4352-B6F4-F0CF121635C2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resturants", "src\Resturants.csproj", "{F74660A2-2891-4352-B6F4-F0CF121635C2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resturant.Tests", "Resturant.Tests\Resturant.Tests.csproj", "{B7932A6A-25FF-416D-95E6-5F0A390C7ECF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F74660A2-2891-4352-B6F4-F0CF121635C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F74660A2-2891-4352-B6F4-F0CF121635C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F74660A2-2891-4352-B6F4-F0CF121635C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F74660A2-2891-4352-B6F4-F0CF121635C2}.Release|Any CPU.Build.0 = Release|Any CPU
{B7932A6A-25FF-416D-95E6-5F0A390C7ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7932A6A-25FF-416D-95E6-5F0A390C7ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7932A6A-25FF-416D-95E6-5F0A390C7ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7932A6A-25FF-416D-95E6-5F0A390C7ECF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
15 changes: 15 additions & 0 deletions Resturant.Tests/EndpointTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Resturant.Tests
{
public class EndpointTest
{
[SetUp]
public void Setup()
{
}

[Test]
public async Task TestGetAll()
{
}
}
}
30 changes: 30 additions & 0 deletions Resturant.Tests/Resturant.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Resturants.csproj" />
</ItemGroup>

<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static async Task Main(string[] args)
builder.Services.AddScoped<IResturantSeeder, ResturantSeeder>();

// Register MediatR and scan for handlers in the current assembly
builder.Services.AddMediatR(conf => conf.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly()));
builder.Services.AddMediatR(configuration => configuration.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly()));

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
Expand Down
File renamed without changes.

0 comments on commit 8bab7dc

Please sign in to comment.