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

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

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

  • @jamesgranberry8801
    @jamesgranberry8801 Год назад +2

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

  • @AceSyntaxx
    @AceSyntaxx 5 месяцев назад +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.

  • @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.

  • @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

  • @MyCodingDiary
    @MyCodingDiary Год назад +1

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

  • @andersborum9267
    @andersborum9267 Месяц назад

    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  Месяц назад

      (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..

  • @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

  • @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.

  • @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.

  • @sanglin9387
    @sanglin9387 4 месяца назад

    my opinion no unit test junk , integeration test

    • @swildermuth
      @swildermuth  4 месяца назад

      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 4 месяца назад

      @@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 .