Building a .NET 6 API Using TDD

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

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

  • @CripplingDuality
    @CripplingDuality 2 года назад +36

    Your content is always worth the wait. I trust your goal is to teach TDD by practice with this series, but I do wonder if the world needs more demonstrations of RESTful APIs...maybe a graphql api or a grpc application in the future? Just a thought. Looking forward to this series!

    • @WesDoyle
      @WesDoyle  2 года назад +1

      great feedback. thanks Natesh!

    • @hackerprincess8810
      @hackerprincess8810 2 года назад +8

      duh yes we do? The world still uses REST APIs in abundance and alot of us value diff content creators sharing how they go about teaching it.

    • @影片程式
      @影片程式 2 года назад +2

      @@WesDoyle
      Can u provide a series of course about Unit Test for C# .
      Your course is really helpful, thanks !

    • @invictuz4803
      @invictuz4803 2 года назад

      Better to focus content and teach one thing at a time.

    • @EduardoSanchez-un2hh
      @EduardoSanchez-un2hh Год назад +2

      Well, most Businesses hire devs to make or maintain RestApis.

  • @Veretax
    @Veretax Год назад +17

    This is quite possibly one of the best C# TDD examples, with an API/WebRequest I've seen on RUclips.

  • @Greenthum6
    @Greenthum6 2 года назад +28

    Thanks for the video! The code looks clean, but I want to give feedback to avoid pitfalls when going into more complex application testing:
    - Unit testing controllers is rarely necessary. This is a controversial topic, but I recommend keeping controller layer as a pass-through for example with mediator pattern and use integration tests to cover the controller code. When doing the design this way there is usually no need to mock anything, just use a real data storage for the tests instead. This makes understanding the code and debugging the failure much easier.
    - Test behavior, not implementation details. The main test here tests that a service calls an external API when calling the controller method. When testing the controller we are not interested how it gets the users, but the fact that it does so. Now the test is dependent on both controller and service interface code. When the service interface changes, the test breaks even though it will return the users correctly.
    - When considering the two issues above and the fact that we still need an integration test to make sure that the users are returned correctly to the caller we start to see why unit testing controllers is not a good idea.
    - Use setup (and teardown) methods to put shared initialization code into one place. The tests are almost the same and are already pretty long for what they do.
    - TDD is much wider concept than unit testing. I see TDD as a tool to test how the system should behave. You start the process before writing any actual production code. This is tough for development-oriented mind. It is easier to think about testing "did it return 404" or "was that method called" instead of "were the requested details of the users stored returned back to the caller correctly".
    The commentary, phasing and the code layout is good. Keep posting!

    • @WesDoyle
      @WesDoyle  2 года назад +3

      All great points, thanks for sharing. Hopefully I’ll make a follow up sharing integration and e2e tests with a larger codebase in the future. All the best 😀

    • @n0pee349
      @n0pee349 2 года назад

      Hello @Greenthum6 I have a question about this statement: "When the service interface changes, the test breaks even though it will return the users correctly".
      Imagine we have sarvice A and this service uses service B. How would u write (unit) tests for service A, that will not breaks after changing interface of service B? Are you testing everything with a "balck box tests" (testing income and outcome) without mocking?
      You wrote that we should not unit test controllers because of integration/e2e tests are covering them. I disagree. Integration/e2e tests are the next layer of tests (they are testing how "integration" with 3-party software works) and they should not be the reason to not write unit tests.
      Can you help me by showing what I'm missing? I'm ready to change my mind.

    • @Greenthum6
      @Greenthum6 2 года назад

      @Tantol You are probably confusing the scope of unit and integration tests. Integration tests are for testing two or more units together. Not only 3rd party, but also your own code components.
      In your example, testing services A and B together is essentially an integration test. If there is already an integration test for testing them together, what value does a unit test add?
      Controllers should have simple logic and only a very few code paths. You ideally want to test all those code paths with integration tests. Then again, unit tests don't add more value. If you only rely on unit tests, you can't be sure how your code works with the rest of the application.
      My advice is to start testing at the service level first and add unit tests where they add value. This helps to understand how your service works and how it solves the actual business problem.

    • @n0pee349
      @n0pee349 2 года назад

      ​@@Greenthum6 "testing services A and B together is essentially an integration test" I meant not togheter. I meant testing only service A that uses service B that I'm mocking in ex.:
      I would test if my function X from service A calls function Y from service B by mocking and verifying if it was called. And now if I change interface code for service B my tests on service A will not work even if outcome of function Y is the same as before - "When the service interface changes, the test breaks even though it will return the users correctly" My function Y (from service B) still returns same users after interface change. How to test this scenario to prevent breaking tests after interface change?
      This is where I have struggle for service scenario.
      For controller scenario now I see your point that this makes no sens to write unit tests on top of integration tests (waste of time and money).
      But for me it dose not make sense when testing service with mocking. These tests will always break after interface change and those I call unit tests (I'm separating logic by mocking).
      Or mb. I misinterpreted you and that sentence was only meant with controller in mind? If so I have no more questions.

    • @Greenthum6
      @Greenthum6 2 года назад +2

      @Tantol My response was mainly for controller testing. Unit testing a service does not make sense as you unit test only a part of it. When service B changes its interface, your unit test for service A still works since the mock is using the previous interface. When you update the production code in service A to newer service B your unit test may also break at build time, or it could just work depending on the mock code. Service interface changes should be rare, but unavoidable. If you have a lot of mocks there may be some manual rewriting needed. This is where an integration test is often better as it tests more the behavior than the implementation details. As a side note, I hate to read abundant mock code. It is really hard to understand later.

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

    Thank you so much for clarification of this very complex and complicated topic!
    It would be nice if you show how to test actual repositories and services using this repositories. But you actually showed how to test controllers and proxies.

  • @damianfijoek2037
    @damianfijoek2037 2 года назад +5

    53:27 to remove all the unnecessary usings you can just press ctrl + k + e. Also, instead of replacing positions of brackets, you can set in IDE how ctrl + k +d should place them

    • @FabioGalanteMans
      @FabioGalanteMans 2 года назад +1

      ctrl + r + g

    • @WesDoyle
      @WesDoyle  2 года назад +1

      thanks! i’m using a combination of vim and resharper keybindings

    • @stevehiggin
      @stevehiggin 2 года назад +6

      Please do not place { on the same line as the method, thats nots the dotnet way 🤣…

    • @sudidav
      @sudidav 2 года назад +4

      @@stevehiggin it seems weird to have that in C#.🤣🤣

  • @2005Azm
    @2005Azm 2 года назад +1

    I was waiting for this! Good to see you back!

    • @WesDoyle
      @WesDoyle  2 года назад

      Thanks! Great to hear from you. All the best

  • @rodrigo6459
    @rodrigo6459 2 года назад +1

    PURE GOLD!!! Loved it!

  • @girornsveinsson7970
    @girornsveinsson7970 2 года назад +6

    Thanks for a great video. I have kind of the same question as Cris Yapp though. It looks like you changed SetupBasicGetResourceList(List expectedResponse, string endpoint) method off camera so there you are no longer using the endpoint parameter. When left unchanged the test will fail for reasons I do not understand, even though the UsersService is not harcoded with the foo endpoint but using the config. It would be great to get some explanations for this.

    • @fatihgenc7385
      @fatihgenc7385 2 года назад +3

      Yes, actually I think it was an unnecessary parameter even at beginning, we are giving endpoint to conf ( options ) then giving it to UserService through constructor, that means it will request to endpoint we give, no need to give it also at the mockhandler method call. I guess he noticed and changed it but forgot the record or editing video.

  • @VinuP2023
    @VinuP2023 2 года назад +2

    Hi Wes!, glad to see you back
    We hope you create more videos this year..
    Its always great to learn from you😊

    • @WesDoyle
      @WesDoyle  2 года назад +1

      Hi Vinay Palaksha, thanks for the message! Lots of content planned for this year. All the best

  • @TheYasieso
    @TheYasieso 2 года назад +1

    Great you're back Wes!! And with great content, as always!!

  • @vuhoang5903
    @vuhoang5903 7 месяцев назад

    Oh god, this is the exact tutor I need right now.

  • @javierolazaran7227
    @javierolazaran7227 2 года назад +1

    Great to see you back! Great content as usual.

    • @WesDoyle
      @WesDoyle  2 года назад

      Thanks, Javier. Great to be back!

  • @zakitl6323
    @zakitl6323 2 года назад +1

    Thank you Wes, we missed your videos😀

  • @pedrofreitaslima
    @pedrofreitaslima 2 года назад +1

    Thank you very much, your content help me because i need learn TDD and you taught very well now i can implement this patterns

  • @Mo-ef9yt
    @Mo-ef9yt 2 года назад +1

    Hi Wes!
    Nice to have you back 🙂

    • @WesDoyle
      @WesDoyle  2 года назад

      Great to be back!

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

    Great example bro!

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

    Good explanation on TDD. thanks.

  • @EduardoMartinez-dm5pp
    @EduardoMartinez-dm5pp Год назад +1

    I'd like to help out adding some hot keys and commands to make your coding even swifter:
    Edit a class or object's name and replace it in all its callings: -}> Ctrl + R + R
    Add a new file .cs (interface, class, etc) -}> ctrl + shift + A
    Open the Quick actions and refactorings: -}> Ctrl + . (dot)
    I'll keep adding more hot keys as I follow the video

  • @jephrennaicker4584
    @jephrennaicker4584 Год назад

    Great video, for beginners, shows how easy unit tests can be to how complex unit test could be

  • @eduardkoryagin4792
    @eduardkoryagin4792 2 года назад +2

    Thanks a lot! Usually I decare tested class and mocks as local variables in test class and create it in constructor. In this case in test method all we have to do - setup mocks, execute method and do assert/verify. If we add new parameter into tested class constructor - refactoring is much easier.

    • @WesDoyle
      @WesDoyle  2 года назад

      Great insight on a nice way to set up tests, Eduard.Thanks!

  • @ryadean
    @ryadean 2 года назад +1

    Welcome back Wes, hope you are well. Strangely I was on your channel the other day and was wondering where you had gone!

    • @WesDoyle
      @WesDoyle  2 года назад +1

      Thanks for the message Ryan! More to come!

  • @sshado2
    @sshado2 2 года назад +1

    This is such a valuable tutorial. Thank you so much.

    • @WesDoyle
      @WesDoyle  2 года назад

      Glad it was helpful!

  • @abhishekdube9004
    @abhishekdube9004 2 года назад +4

    Hi Wes,
    This is really a great video and helped me a lot to gain a new perspective to approach a problem statement or requirement.
    You made me fall in love with the TDD approach :D
    I would really like to see how we can further use this approach to create loosely coupled architecture with a database (SQL / No SQL). Will we see more continuation of this video?

  • @AayushRastogiKnowMe
    @AayushRastogiKnowMe 2 года назад +1

    Very well explained Wes. Great work. I recently started watching your videos , and love them.

  • @muyiwaishola3196
    @muyiwaishola3196 2 года назад +1

    Thanks for sharing, Wes!

    • @WesDoyle
      @WesDoyle  2 года назад

      Thanks for watching, Muyiwa Ishola!

  • @zeldaire7484
    @zeldaire7484 Год назад

    Such an awesome and concise video.

  • @WesDoyle
    @WesDoyle  2 года назад +3

    Thanks for watching! What would you like to see next?

  • @jimmydavila7196
    @jimmydavila7196 2 года назад +1

    Thank you Wes. Good tutorial as usual.

    • @WesDoyle
      @WesDoyle  2 года назад

      Glad it was helpful! Thanks Jimmy.

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

    I think I understand the most of ot, but I will have to retake that lesson later becasue the part about MockHttpRequest is a little bit too fast and complicated for me. I need to disassemble it into smaller pieces :D
    Great video though!
    But im my opinion there are things that you should change a bit :
    -Go a little slower, I had to stop the recording several times in order to find myself and catchup.
    -you should Go more into details, because you go like " I do that, and then that" bo no explenation why etc.
    - sometimes you just click stuff really fast without additional comments. That would also be nice :)

  • @diegosramirez
    @diegosramirez 2 года назад +1

    This is so useful! thank you!

  • @andydevtrost3587
    @andydevtrost3587 Год назад

    thanks for this awersome course .

  • @saeed-ahmadvand
    @saeed-ahmadvand Год назад

    Thanks for sharing. This video was very useful for me.

  • @danzaverdk
    @danzaverdk 2 года назад +4

    hi wes!, just keep on doing what you are doing, honestly this channel needs more views, i learned alot from wes and will always learn more. thank you so much wes!

    • @WesDoyle
      @WesDoyle  2 года назад

      I appreciate that, Albert!

  • @kitsurubami
    @kitsurubami 2 года назад

    This video is great! Thank you for making it for us. I'll definitely check out your other stuff.

  • @mohammad.daglas
    @mohammad.daglas 2 года назад +1

    Thank you very much for the great content!

  • @IgorTimarac
    @IgorTimarac Год назад +13

    Never return 404 instead of empty lists, it's a bad API design. Do return 404 for not found objects, though (e.g. for GET /users/42 when no user with the ID of 42 exists).

  • @milesvendetti-houser1889
    @milesvendetti-houser1889 2 года назад +1

    AYYYY WES IS BACK!

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

    hi - in this example tests of the external api takes a place - do you /have a video where you testing dbcontext? My application controllers are handling crud operations on existing db and its tables. I was wondering if you can show how to mock this type of scenario?

  • @miklosmoricz
    @miklosmoricz 2 года назад +3

    Thumbs up! But I cannot really understand, why you fight againt your IDE in order to force Javascript-type bracket indentation. :)

  • @amartinezldn
    @amartinezldn 8 месяцев назад

    Great tutorial, thank you!

  • @aminkhosravi5073
    @aminkhosravi5073 Год назад

    Hi Wes! I was wondering how I can test CRUD operations following your procedure. Take Delete for example. How should I register mock service when the API returns NoContent Status Code? something like mockService.Setup(service=> service.DeleteUser(id)).Returns()...I don't know how to complete this piece of code after Returns for a Delete Function which is registered as a task without any return object in UserService!

  • @primavera919
    @primavera919 Год назад

    Thank you for the tutorial but do you have an "INSERT" OCD? Why do you need to press "insert" every other keyboard press?

  • @chrisyapp3308
    @chrisyapp3308 2 года назад +8

    Great video Wes! Glad to se your vids back!.. I just had one question though as I was following along, when you set up the mock HttpMessageHandler and then you created the overloaded function SetUpBasicGetResourceList(List expectedResponse, string endPoint), I noticed that at first you created a custom HttpRequestMessage obj, then passed that in as a parameter in to the handlerMock.Protected().SetUp() instead of using ItExpr.IsAny(), then at the end when the test failed and you returned to that Mock it was changed back to ItExpr.IsAny() and there wasnt a custom HttpRequestMessage obj being used... what did I miss? Keep up the content dude!

    • @vladdragomir2804
      @vladdragomir2804 2 года назад +1

      Thank you so much for this comment! :)
      I kept searching where I deviated from the code and finally found this comment - saved me a lot of headaches!

  • @the_lucas
    @the_lucas 8 месяцев назад +1

    The video is good.
    do you program with Java or javascrip? Why fight with visual studio adjusting the curly brackets 😅?

  • @lastidea4925
    @lastidea4925 2 года назад

    6:33 here's a quick tip: if you write ".\SolutionName.sln" it will run Visual Studio and open your solution.

  • @abbasfais
    @abbasfais Год назад

    A video on a web api/web dev project that is solid compliant would also be very much appreciated.

  • @finnbenson1826
    @finnbenson1826 2 года назад +1

    fantastic video
    thank you

  • @geeksy2278
    @geeksy2278 2 года назад +3

    Love it! Very cool! Can you make a video on how to become a .NET developer. In my area there are tons of jobs for .net and I would love to make the switch. Keep it up!

    • @WesDoyle
      @WesDoyle  2 года назад +1

      Great suggestion!

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

    Hello, thank you for creating very educational content. I was wondering what is the console/termain you used in the beginning? The one with the tabbing options on top

  • @RoamingAdhocrat
    @RoamingAdhocrat 2 года назад

    1:26:00 why are we setting up a near-duplicate of `SetupBasicGetResourceList` rather than just adding an `endpoint` parameter to the original method?

  • @kevinmarkandrada
    @kevinmarkandrada 2 года назад +2

    Hi Wes, would you prefer the typical Controller.cs or the new minimal api setup?

    • @WesDoyle
      @WesDoyle  2 года назад +1

      Hi Kevin, great question. I'd say it depends on a few factors! One consideration would be overall application architecture. The minimal API setup seems ideal for thinking small services / microservices pattern.

    • @kevinmarkandrada
      @kevinmarkandrada 2 года назад +1

      @@WesDoyle Looking forward to have that in your next content. Good to see you back sir!

  • @ahmedelgendy5363
    @ahmedelgendy5363 2 года назад

    Thanks a lot I am now very interest to Apply the TDD Concept in my work.

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

    hey, appreciate the video. what fonts are you using?

  • @tony-ma
    @tony-ma 2 года назад +1

    Hi @Wes, what browser and extension did you use to inspect the web API response at 1:38:17?

    • @WesDoyle
      @WesDoyle  2 года назад +1

      Hi Tony! I'm using Firefox Developer Edition here. Thanks for watching!

  • @josehuertas877
    @josehuertas877 2 года назад +1

    Great video!

    • @WesDoyle
      @WesDoyle  2 года назад

      Thanks for watching!

  • @simplepycodes
    @simplepycodes 2 года назад +1

    Thanks a lot, very informative and helpful, perfect ..

  • @alexwexov4298
    @alexwexov4298 2 года назад

    Glad to see that you use the Vim plugin :)

  • @seth6072
    @seth6072 2 года назад +1

    In your Get_OnSuccess_InvokeUserServiceExactlyOnce(), you define a sut and result but never do anything with them. Whats the point of this? 42:59

  • @pitthp
    @pitthp Год назад

    Hi there, you mentioned that we can use some factory implementation for repeating (duplicate) code. Do you have example for that?

  • @martinrohwedder6618
    @martinrohwedder6618 Год назад +6

    Out of curiosity. Why do you create your project files using the command line, rather than just using Visual Studio GUI? BTW I love your video. Very educational :)

  • @henrik3098
    @henrik3098 Год назад

    Wow nice video man =)

  • @ThugLifeModafocah
    @ThugLifeModafocah 2 года назад +1

    Are you using some Vim emulator for visual studio? If so, which one?

  • @R.Daneel
    @R.Daneel 2 года назад +1

    Please change the settings on your editor style preferences so we don't have to watch you move the brackets every single time you add a line of code.

  • @ryanzwe
    @ryanzwe 2 года назад +2

    I'd love to see this done with NSubstitute

  • @yavuzalter359
    @yavuzalter359 2 года назад +1

    Thanks for the video.

    • @WesDoyle
      @WesDoyle  2 года назад

      Thanks for watching!

  • @samuhuse6706
    @samuhuse6706 8 дней назад

    are you testing the controller implementation ? :(

  • @DayMan85Theater
    @DayMan85Theater 2 года назад +1

    I'm only recently working on wrapping my head around unit testing and TDD more specifically. I'm curious, in GetAllUsers_WhenCalled_ReturnsListOfUsers, would it be good to give the handlerMock a COPY of the expectedResponse Users list and then assert that result and expectedResponse contain the same items? By only asserting the count, you don't know for sure that the list isn't being manipulated in some other way after being returned from the HttpClient. Or is that overkill?

  • @jonwall9634
    @jonwall9634 2 года назад +1

    Hi Wes, thanks for posting this video I am learning some new concepts here.
    I am coding along with the video and have ran into a problem at around 1h14m when "GetAllUsers_WhenCalled_InvokesHttpGetRequest()" and "GetAllUsersWhenCalled_ReturnsListOfUsers()" both return the same failed test message.
    The message reads: "System.ArgumentException : No protected method HttpMessageHandler.SendAsync found whose signature is compatible with the provided arguments (HttpResponseMessage, CancellationToken)."
    As far as I am aware I have copied the coding perfectly, but it is possible I have made a mistake somewhere.
    Do you know what is causing these tests to fail?
    Thanks in advance,
    Jon

  • @leeliquid85
    @leeliquid85 2 года назад +1

    Hi, this has always been a question I have on my mind. Is there any particular reason that you choose to use command line to create new solution and projects vs using Visual Studio or something has a GUI?

    • @WesDoyle
      @WesDoyle  2 года назад

      just for convenience!

    • @yt-1337
      @yt-1337 2 года назад +1

      why would you go to vs and click through all that shit, if you can just do 3 commands

  • @stomic50
    @stomic50 Год назад +3

    anyone else triggered by Wes moving { up with method names? :D

  • @danijelzg001
    @danijelzg001 2 года назад

    Does the creating interface IUserService first for that InvokesUserService breaks the tdd pattern? Don't see point in creating mock of something that does not exists, you get build errors and you lose intelisense

  • @danielcarlstrom1981
    @danielcarlstrom1981 2 года назад +2

    Thanks for this great video!
    I'm curious about what font / colors / theme settings you use for Visual Studio?
    Do you have some information on that somewhere? (new subscriber here)
    All the best!

    • @WesDoyle
      @WesDoyle  2 года назад +1

      Hi Daniel! I have a repo on my GitHub called dotfiles that contains settings for all of my tooling. All the best to you, thanks for subscribing!

  • @marktide4632
    @marktide4632 Год назад

    Hi, I have some comments which are to help future tutorials. I managed to follow up to nearly the end and then boom all went pear shaped. Being a novice I have not the skills to work out the problems.
    My comments are, perhaps go a little slower, the keyboard clicking and the constant movement of your cursor for no reason is really distracting. It would be nice to have a resource file. Thus for people like me that have followed along but some where missed a key line and it goes wrong we would be able to look at the working code and see where we didn't follow your quick commentary close enough. I mean this by no means to be negative. :)
    Thanks for the video.

  • @mr.nobody4494
    @mr.nobody4494 2 года назад +1

    Thanks! 👌

  • @RoamingAdhocrat
    @RoamingAdhocrat 2 года назад

    OK, got a really weird bug here / user error - I can't get the project to build / rebuild within Visual Studio. I make an edit e.g. change `return Ok("all good");` to `return Ok(users);` . Save the file. Hit "Run" in Test Explorer and the test is still failed. Run `dotnet test` in the terminal and it actually rebuilds the project and shows the test passing.
    How do I convince VS to actually rebuild the project?

    • @RoamingAdhocrat
      @RoamingAdhocrat 2 года назад

      Found it. But am more baffled as a result. I had the Solution Explorer in Folder View - which somehow stops the tests from rebuilding the projects...?

  • @prof_as
    @prof_as 7 месяцев назад

    how you are able to type this fast ? . I noticed you are using some sort of tool that looks like vim. can you tell the name of the tool.
    by the way the video is great, easy explanation.

  • @codingbloke
    @codingbloke 2 года назад +1

    Thumbs up. (Despite unnecessary use of Newtonsoft 😜).

    • @WesDoyle
      @WesDoyle  2 года назад

      :) Old habits! Thanks for watching!

  • @oleksiifatichiev
    @oleksiifatichiev Год назад

    Great teaching and explanation of the material. However, I watched it with some difficulty because the constant keyboard clicking was quite distracting.

  • @ItsSalesGabriel
    @ItsSalesGabriel 2 года назад +1

    Thanks for video

    • @WesDoyle
      @WesDoyle  2 года назад

      Thanks for watching!

  • @diegomelgar2696
    @diegomelgar2696 Год назад

    Hi @Wes, wondering if there would be a TDD video using factories, seeding data? Do you know or anyone here an excellent resource where I can find TDD with factories, mocking, seeding using .NET and that uses .NET CORE 6 or above?

  • @anushathomas6882
    @anushathomas6882 2 года назад

    Great explanation, Thank you ! Just one question any particular reason why you did not choose MS TEST project in VS instead of XUnit ? Is it a hard rule that we should use XUnit project for TDD or can we do the same with MS Test ?

    • @WesDoyle
      @WesDoyle  2 года назад +5

      Hi Anusha, MS Test can be used, it’s just a matter of framework preference. Each framework is a bit different! 😄

  • @keychain8886
    @keychain8886 2 года назад

    Hello, I've question how do you solve this error on moq "Handler did not return a response message.",
    I try using same URL Address but still got that error

    • @ghostslinger3148
      @ghostslinger3148 2 года назад

      getting the same error,
      fixed it,
      double check the handlerMock 1:35:24 , he changed back to any httpRequestMessage

  • @geovannycardozocedeno6041
    @geovannycardozocedeno6041 2 года назад +1

    Muy bueno tu video saludos y suscrito

  • @heheh6345
    @heheh6345 2 года назад +1

    Why the heck do you use Insert on your keyboard so much? Drives me crazy.
    Fantastic video though. Appreciate it a lot. Thanks!

    • @WesDoyle
      @WesDoyle  2 года назад +1

      I’m using vim

  • @abbasfais
    @abbasfais Год назад

    Amazing tutorial. So much better than the stupid tutorials that show you some kind of TDD in a command line project with no follow up on how it would be applied to the real world development. Also your way of mocking the HttpClient is something I tried to find a couple of times but failed.

  • @ammarmangala9814
    @ammarmangala9814 2 года назад

    why is there no link to the repo?

  • @HuneSilver
    @HuneSilver 2 года назад

    Hi Wes, what's your theme? It's great !!

  • @FabioGalanteMans
    @FabioGalanteMans 2 года назад

    Can you make the repository available for this project?

    • @WesDoyle
      @WesDoyle  2 года назад

      Hi Fabio, thanks for reaching out. At this time, source code is available to those supporting the channel on Patreon! You can find many other open source projects on my GitHub.

  • @emredevstudio
    @emredevstudio Год назад

    Hey, I came across your videos, they are awesome but you really need to write longer and better titles for visibility

  • @turkerkaraoglu1675
    @turkerkaraoglu1675 2 года назад +4

    Its nice until 1:16:00 , then everything is getting messy. Also not using mouse, instead always using keyboard why? Its very annoying.

  • @ashrafmir9991
    @ashrafmir9991 2 года назад

    Great

  • @nomadnoland
    @nomadnoland 2 года назад +3

    Thanks for the tutorial, but why on earth should we spend one hour and a half to write a simple method that returns a list in a real environment? really I can't get my head around it.

    • @WesDoyle
      @WesDoyle  2 года назад

      in time it takes far less time, of course. and sometimes the answer is likely that you shouldn’t. there always tradeoffs, and everything depends on context.

  • @peculiarpeculiar2504
    @peculiarpeculiar2504 2 года назад +1

    Mehn, how I missed you.

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

    Why can't find NUnit tutorial

  • @atabayilker
    @atabayilker Год назад

    It's an awesome content for people getting into testing, but those unnecessary amounts of key presses got me a bit too hard :D Like WHY :D 17:14 - 17:17. Way too loud for me to concentrate on the actual thing that's going on.

  • @newabyuser
    @newabyuser 2 года назад +1

    Been a while

    • @WesDoyle
      @WesDoyle  2 года назад

      Yes indeed, great to hear from you!

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

    13:00 - in TDD, you would remove that controller completely, and let tests drive creation of it.
    13:20 - premature creation of Helpers and Fixtures
    16:23 - explanation of why it's okay to leave the users controller "we know that's what it's going to look like". that's not tdd. that's coming up with code without tests.
    24:10 - the "all good" string is not necessary for the tests to pass.
    32:10 - you have added the service, the mock and the inject without any tests for that at all. not tdd. you should first write an assertion without ever writing the mock, see the test fail, then implement the service without mocks, and then write another test for the overriden behaviour. in TDD you should not write any code without tests (but you did), and you should not write any more test code that is necessary to make the test fail (which you again did do).
    Not watching anymore since that's clearly not TDD. it's probably a good start to testing, a good introduction to TDD, but that's not TDD.

  • @Ashmaelx
    @Ashmaelx Год назад

    This is not pure TDD. I think you make things more difficult for people who actually want to look at net core TDD, as a 3rd or 4th language, but actually know TDD ...

  • @kresnofatihimani5073
    @kresnofatihimani5073 2 года назад

    this feels like integration tests instead if unit tests

    • @WesDoyle
      @WesDoyle  2 года назад +2

      Hi Kresno, since I'm mocking out dependencies to test the method calls in isolation, I refer to this as unit testing. I tend to call integration tests those tests which encompass a greater system (e.g. integrating a database, network, or hardware). Thanks for watching!

    • @kresnofatihimani5073
      @kresnofatihimani5073 2 года назад +1

      @@WesDoyle i shouldnt have said that sorry. Im a noob. Plz disregard my comment XD just keep the videos comin bro

    • @WesDoyle
      @WesDoyle  2 года назад +1

      @@kresnofatihimani5073 no problem at all! i appreciate the question! all the best

  • @yoanncatala3525
    @yoanncatala3525 2 года назад +1

    Very good content. Thanks a lot for this guide.
    Just a comment as a viewer on something a bit annoying, too many code highlighting and navigation keyboard tricks, as your keystrokes are very loud. It's sometimes hard to focus on what you're saying seeing you going back and forward and highlighting every piece of code. 😉
    Nevertheless, appreciate your effort doing such good video.