ASP.NET Core Integration Testing Tutorial

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024
  • 💻Get the source code: go.dotnetacade...
    Learn how to write integration tests for your ASP.NET Core APIs, step by step.
    Verify your controllers in real-world scenarios by bootstrapping your entire app in memory, using a real database and even deal with endpoints that require authorization.
    🔥Become a Senior C# Backend Engineer: juliocasal.com...
    🗺️Get My Free .NET Backend Developer Roadmap: juliocasal.com...
    Join me on Patreon: / juliocasal
    Follow me on LinkedIn: / juliocasal
    Follow me on X: x.com/julioc
    #csharp #aspnetcore #softwaretesting

Комментарии • 28

  • @shadowsir
    @shadowsir 11 месяцев назад +7

    This is exactly how we've set up integration tests with one exception. We're using "test containers" to generate a whole bunch of docker based databases. That way you can still run tests in parallel without them getting in each other's way.

    • @juliocasal
      @juliocasal  11 месяцев назад +2

      Ohh, great idea! Will check it out.

  • @watherby29
    @watherby29 7 месяцев назад +3

    Finally normal pace. Thank you.

  • @thomasfgooch
    @thomasfgooch Год назад +4

    Loving this! Thanks, I always have written unit tests but never integration

  • @TellaTrix
    @TellaTrix 7 месяцев назад +2

    Wow very Amazing content you produced on your RUclips channel. Really apricate your efforts

  • @user-iq334
    @user-iq334 7 месяцев назад +2

    Great video, thanks for the effort put into this.

  • @leonguerrero1745
    @leonguerrero1745 Месяц назад +1

    Gracias por compartir Julio!

  • @MartinHAndersen
    @MartinHAndersen 9 месяцев назад +2

    Thanks a gazillion. Super videi, was really helpfull 😊😊

    • @juliocasal
      @juliocasal  9 месяцев назад

      Glad it was helpful!

  • @luisfernandodeolazabalsche3317
    @luisfernandodeolazabalsche3317 4 месяца назад +1

    Gracias Julio.

  • @eduardocabral707
    @eduardocabral707 10 месяцев назад +2

    Besides "Database.EnsureDeleted", I also had to add "Database.EnsureCreated"

    • @juliocasal
      @juliocasal  10 месяцев назад +2

      That may be needed if your app doesn't run migrations on start, which would create the DB for you.

  • @newoverlord9507
    @newoverlord9507 10 месяцев назад +1

    this video was very well made but I got stuck at the InternalsVisibleTo step, the same error still showed in the Program not being visible to the tests project

    • @juliocasal
      @juliocasal  10 месяцев назад

      Did you use the correct project name? InternalsVisibleTo should just work.

    • @newoverlord9507
      @newoverlord9507 10 месяцев назад +1

      @@juliocasal No, the only thing that worked for me was including
      public partial class Program {} in the program.cs file

  • @valeriyaleksandrovich2707
    @valeriyaleksandrovich2707 11 месяцев назад +3

    It will be better if you add link to git repository. Much cannot be repeated. What you show is taken out of context👎

    • @juliocasal
      @juliocasal  11 месяцев назад

      Here: www.patreon.com/posts/88196476

    • @valeriyaleksandrovich2707
      @valeriyaleksandrovich2707 11 месяцев назад +1

      @@juliocasal If you share your experience here, complete it instead of starting here, and you will learn the rest from the course. This is the worst thing that exists and there is not the slightest desire to attend such courses, since it is possible that everything necessary will not be there and another course will be required, and so on. With this approach, I wish you to have as few subscribers and people willing to buy your courses as possible.

    • @juliocasal
      @juliocasal  11 месяцев назад

      @@valeriyaleksandrovich2707 Which course? All you'll find there is the full source code.

    • @valeriyaleksandrovich2707
      @valeriyaleksandrovich2707 11 месяцев назад

      @@juliocasal if I saw the code, I would say Thank you, but I see the cartridge and you have to pay for the connection