Giter Club home page Giter Club logo

leetcode-csharp's Introduction

C# with VSCode, xUnit, and internal debugger

Approach 01: Command line

  1. $ dotnet new console -n Leetcode
    It will create a folder Leetcode/ and keep everything in it.

  2. $ dotnet new xunit -o Leetcode.Test
    It will create another folder Leetcode.Test and keep everything in it. So, far these 2 projects are independent, and no connection to each other.

  3. $ dotnet add Leetcode.Test/Leetcode.Test.csproj reference Leetcode/Leetcode.csproj
    It will add the Leetcode entry into Leetcode.Test

  4. Make your changes

  5. $ dotnet build OR $ dotnet test OR $ dotnet run

    • Other options: $ dotnet test --filter FullyQualifiedName~L0140 # to run tests only for a certain namespace

In this way you can control the project via terminal. However, you cannot run a debug.

Approach 02: via VS-Code

  1. install C# Dev Kit and formulahendry.dotnet-test-explorer extension.
  2. Open vscode into new folder
  3. Command Pallette > .NET new project > Console App > Folder name = Leetcode
    It will create a new folder Leetcode\, along with other settings as well.
  4. Command Pallette > .NET new project > xUnity New Project > Folder name = Leetcode.Test
  5. By now, you should be able to test via Test Explorer OR $ dotnet test
  6. $ dotnet add Leetcode.Test/Leetcode.Test.csproj reference Leetcode/Leetcode.csproj
    It will add the Leetcode entry into Leetcode.Test
  7. To debug
  • Add breakpoints.
  • use Command Pallette > Test: Debug All test OR Test: Debug Tests in Current File
    • Other options: Test: Debug Last Run OR Test: Debug Failed Tests

leetcode-csharp's People

Contributors

patwari avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.