Skip to content

nsharifzadeh/dotnet-core-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyApp

A .NET Core console application with unit tests.

Project Structure

MyApp/
├── src/
│   └── MyApp/              # Main application
├── tests/
│   └── MyApp.Tests/        # Unit tests
└── MyApp.sln               # Solution file

Prerequisites

  • .NET 8.0 SDK or later

Project Setup

Create the Structure Using CLI

  1. Create the project directory:
mkdir MyApp
cd MyApp
  1. Create a solution:
dotnet new sln -n MyApp
  1. Create the console app project inside src:
dotnet new console -o src/MyApp
  1. Create a test project inside tests:
dotnet new xunit -o tests/MyApp.Tests
  1. Add both projects to the solution:
dotnet sln add src/MyApp/MyApp.csproj
dotnet sln add tests/MyApp.Tests/MyApp.Tests.csproj
  1. Add a reference from the test project to the main app:
dotnet add tests/MyApp.Tests/MyApp.Tests.csproj reference src/MyApp/MyApp.csproj
  1. Run the tests:
dotnet test

Getting Started

Clone and Setup

git clone <repository-url>
cd MyApp
dotnet restore

Build

dotnet build

Run Tests

dotnet test

Run Application

dotnet run --project src/MyApp/MyApp.csproj

Development

This project uses:

  • .NET 8.0 - Target framework
  • xUnit - Testing framework

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages