Coding Short: Is This Thing On? Testing APIs in .NET Core

Поділитися
Вставка
  • Опубліковано 15 січ 2025

КОМЕНТАРІ • 16

  • @AceSyntaxx
    @AceSyntaxx 6 місяців тому +1

    Thanks Shawn for a succinct explanation of the basics.

  • @rustamhajiyev
    @rustamhajiyev Рік тому +2

    Thanks for caring about us 😅 Great one as usual 👍😃 In our projects we usually use integration tests, in a similar way that you demonstrated. We also use LightBDD + pattern given/when/then and write tests in a story like way, so anyone can read and understand them.

  • @jamesgranberry8801
    @jamesgranberry8801 Рік тому +2

    Shawn Wildermuth “cares about me?!” Awww. Lol!

  • @MyCodingDiary
    @MyCodingDiary Рік тому +1

    Wow, this video is amazing!😲 Your programming skills are truly impressive.

  • @godfathermikal
    @godfathermikal Рік тому

    I like that you used web app factory. This seems to be a fantastic tool to have in the bag. Would love to see more on how you use it for more than quick demo tests.

  • @JesseLiberty
    @JesseLiberty Рік тому +1

    At 1:20 or so you refer to your new favorite toy for developing APIs. Can you say more about it (what the name is, what it does, why it is better than Postman)? Thanks! - jesse

  • @alessandropinto1529
    @alessandropinto1529 Рік тому

    Thank you Shawn, I was wondering how to set up Integration tests inside the solution (I generally use an external tool), and it was really illuminating for
    me

  • @prasadgopi831
    @prasadgopi831 Рік тому +1

    Informative and straight to the point. Will there be any session recordings of kcdc event 2023 available anywhere?

    • @swildermuth
      @swildermuth  Рік тому

      Unfortunately, it wasn't recorded.

  • @catfishfortesque-smythe437
    @catfishfortesque-smythe437 Рік тому +1

    I don't think that IClassFixture works in this way: from the xUnit Documentation, this creates a single object which is then shared with all test in a class - and it's the test class that has a new instance for each test, with the shared fixture being passed to it. I.E it is only created once, and so does not provide a clean object. To achieve that, you would need to use constructor / dispose in the test class to have a new object instance created. IClassFixture is intended to avoid expensive initialisations.

  • @aborum75
    @aborum75 2 місяці тому

    While what’s shown here is a great start, make sure to get very familiar with mocking and ways of producing deterministic (yet random) data to use for assertions etc.
    Shaun’s going around this with very simple examples and you’re likely going to face much more complexity on larger projects. I’m a big fan of terse tests and being true to the SOLIS principles, leading to small units of code, but not all teams are aligned on this topic (or as experienced).

    • @swildermuth
      @swildermuth  2 місяці тому

      (it's *Shawn* btw) I agree with this. My examples are simple and building up for real-world is more complex. But, again, this type of APIs aren't Unit tests. These should be integration tests (smaller set than Unit tests). I wouldn't necessarily need every test/permutation tested as Unit Tests should test those. This is about testing your units working together..

  • @sanglin9387
    @sanglin9387 6 місяців тому

    my opinion no unit test junk , integeration test

    • @swildermuth
      @swildermuth  6 місяців тому

      I don't actually agree, I think there is value in unit tests, but trying to unit test for code coverage is a waste of time. IMHO

    • @sanglin9387
      @sanglin9387 6 місяців тому

      @@swildermuth people will do by pass code just to make 100% not to test foreign key , output and input . Unit test maybe good before real implementation but once back end and front end good to go , integration test is the way to go . Most sample unit test a + b , most in real life got formula so on , so we need to make sure it work first in first out .