C# Unit Testing Tutorial For Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

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

  • @ReshmaRaj-s6i
    @ReshmaRaj-s6i 3 หลายเดือนก่อน +2

    This video is definitely worth watching! As a beginner in unit testing, it really helped me grasp the basic concepts. I appreciate the effort put into making such a well-structured presentation.

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

      Glad it was helpful!

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

    I wouldn't perse agree with "Verify a small piece of code" A unit can be completely isolated or talk to multiple components. If we look at the definition given by M. Feathers then it is not a unit test when:
    - It talks to the database
    - It communicates across the network
    - It touches the file system
    - It can’t run at the same time as any of your other unit tests
    - You have to do special things to your environment (such as editing config files) to run it
    I am not sure where it exactly went wrong but unit tests are really misunderstood leading to testing implementation details instead of observable behavior. If you take your traditional layered application then I could still be writing a unit test at a controller level going all the way through my service and repositories. Now that doesn't take away that you can test something in isolation (which you have shown) but it surely creates a fragile test suite when overdone.
    Vladimir Khorikov has a great book on this imo.

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

      From Vladimir's book:
      "A unit test is an automated that verifies a small piece of code (also known as a unit), does it quickly, and does it in an isolated manner"

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

      @@juliocasal sorry my reference to vladimir was about the different types of unit tests. Not perse his definition of a "unit" (which I actually cannot recall). In his book he mentions at least 3 different types, where one is related to collaboration which in fact does not mean that you specifically test a small piece of code and thats one where we tend to refer to integration tests which isnt really the case.

  • @luisfernandodeolazabalsche3317
    @luisfernandodeolazabalsche3317 7 หลายเดือนก่อน +2

    Muchas gracias Julio.

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

      De nada!

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

    Hi Julio, do you have any plan to add unit and integration testing sections in your microservices course?
    It would be very helpful.
    Thanks.

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

      Here: juliocasal.com/csharp-unittesting-essentials

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

      @@juliocasal I know you've launch a course on unit testing, but I'm talking about the microservices course.
      Does microservices course cover the unit testing of code which we write in that course? Or any zip file in the section that included unit testing code for the course?

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

      @@azraiqbal187 No, unit testing is a broad topic that needs its own space. Everything I know about unit testing is now in my unit testing courses.

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

      @@juliocasal Thanks for responding 🙂

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

    Is there any public git repository of the GameLibrary full project with unit test?

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

      No, full source code is available in my Patreon community: www.patreon.com/juliocasal