ASP.NET Core Integration Testing Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2025

ความคิดเห็น • 36

  • @shadowsir
    @shadowsir ปีที่แล้ว +10

    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  ปีที่แล้ว +2

      Ohh, great idea! Will check it out.

  • @watherby29
    @watherby29 ปีที่แล้ว +4

    Finally normal pace. Thank you.

  • @TellaTrix
    @TellaTrix 11 หลายเดือนก่อน +3

    Wow very Amazing content you produced on your TH-cam channel. Really apricate your efforts

    • @juliocasal
      @juliocasal  11 หลายเดือนก่อน +1

      So nice of you!

  • @user-iq334
    @user-iq334 ปีที่แล้ว +2

    Great video, thanks for the effort put into this.

  • @eduardocabral707
    @eduardocabral707 ปีที่แล้ว +2

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

    • @juliocasal
      @juliocasal  ปีที่แล้ว +2

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

  • @leonguerrero1745
    @leonguerrero1745 5 หลายเดือนก่อน +1

    Gracias por compartir Julio!

    • @juliocasal
      @juliocasal  5 หลายเดือนก่อน

      De nada!

  • @alperenbaytimur
    @alperenbaytimur 17 วันที่ผ่านมา

    you know, you might have saved me just now, although my sprint is failed, I atleast have hope of fixing it within 1 or 2 days now, thanks to you

    • @juliocasal
      @juliocasal  17 วันที่ผ่านมา

      I'm glad!

    • @alperenbaytimur
      @alperenbaytimur 17 วันที่ผ่านมา

      @@juliocasal one question though, sir to where are you adding a reference in 2:30, is it to your initial program, or to your new project ?

  • @udayaminul2533
    @udayaminul2533 หลายเดือนก่อน

    did you use microsoft testserver here? also is there a problem if i use moq?

    • @juliocasal
      @juliocasal  หลายเดือนก่อน

      Just the WebApplicationFactory. No issues with moq.

  • @newoverlord9507
    @newoverlord9507 ปีที่แล้ว +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  ปีที่แล้ว

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

    • @newoverlord9507
      @newoverlord9507 ปีที่แล้ว +1

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

  • @MartinHAndersen
    @MartinHAndersen ปีที่แล้ว +2

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

    • @juliocasal
      @juliocasal  ปีที่แล้ว

      Glad it was helpful!

  • @manuelsuarez3d
    @manuelsuarez3d 3 หลายเดือนก่อน

    Tried this tutorial but for some reason the Integration testing continues to use my actual Database connection instead of my In-Memory one?

    • @juliocasal
      @juliocasal  2 หลายเดือนก่อน

      There's no in-memory database.

  • @nirajchandrajoshi
    @nirajchandrajoshi 3 หลายเดือนก่อน

    In my project, API endpoint expects JWT bearer token, This approach is not working for me, please guide me how to pass jwt token while doing integration testing.

    • @josecorral9645
      @josecorral9645 3 หลายเดือนก่อน

      Just prepare the database image to contain certain data, handle the token signature just as the connection string is being handled in this video, then as part of your arrange generate the token.
      This is a great starting point, try to expand it to cover your needs.

    • @juliocasal
      @juliocasal  2 หลายเดือนก่อน

      What is not working?

  • @luisfernandodeolazabalsche3317
    @luisfernandodeolazabalsche3317 9 หลายเดือนก่อน +1

    Gracias Julio.

    • @juliocasal
      @juliocasal  9 หลายเดือนก่อน

      De nada!

  • @valeriyaleksandrovich2707
    @valeriyaleksandrovich2707 ปีที่แล้ว +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  ปีที่แล้ว

      Here: www.patreon.com/posts/88196476

    • @valeriyaleksandrovich2707
      @valeriyaleksandrovich2707 ปีที่แล้ว +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  ปีที่แล้ว

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

    • @valeriyaleksandrovich2707
      @valeriyaleksandrovich2707 ปีที่แล้ว

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