Simple but yet informative and your video covers basically all that is needed to know about NUnit Project unit testing. I was a bit confused but thanks to your tutorial, it made things more easier to understand. Keep up the good work.
I have been seen multiples videos for many years. This is the first one that I understand the all explanation. To be honest, you are so good doing this. Congrats!
love the video..following the steps and actually I'm understanding what it is trying to do now.thank you! never write unit test and I'm expecting to have an interview to cover that.LOL
Don't know what you are talking about? There is no NUnit for .Net Framework in VS2019 default installation. That is the part on minute 2 where you stumble upon.
Hi, what type of project of Bank? Is it "Class library" or "Console application"? How can I create "Console application" and link it with project of NUnit test. I was repeating after you and create project "Bank" as "Console Application" then I create project of NUnit test, then clicked on project test and added reference to "Bank". But when I tried to create instance of "Bank" my test method didn't see Bank class
Make sure the Bank class is public and also make sure you added the namespace of the Bank class. If you still have issues you can find the complete code here: github.com/MatthiWare/UnitTesting/blob/master/BankNUnitTests/BankAccountTests.cs
@@MatthiWare thank you so much, I tried to figure out how to set it up for three days. But mistake was in directive of using, I forgot to write it in project, but actually I didn't know that I must to write it
Hello Matthi, thank you for the wonderful video. It was very helpful to get me started. I have an issue that I find difficult to solve though. I want to run a unit test on a private method. When I Arrange the class to test on, I cannot call the private method because it is private to that class. I know I could make it public, but I would rather not do that. What could I do in Unit Testing to test a private method?
Hi, making the method public is indeed not a good idea. What you'll need to do is test the public methods that call the private methods. Best case would be that by only testing the public method(s), you also tested all possible code paths in the private method(s).
Which NUnit packages did you install. I installed "NUnit" and "NUnit3TestAdapter". When I try to run the test, nothing is displayed in the "test explorer". I'm using "VS2019 community". Can you give me any advice? Great tutorial btw!
Hi that should be correct, you can double check with the ones I used here github.com/MatthiWare/UnitTesting/blob/master/BankNUnitTests/BankNUnitTests.csproj or try out my finished project in the github repo locally and see if that works. I've also had troubles with running tests a couple of times but normally there should be an error log in the console of visual studio, you can use that message to find a solution on stackoverflow for example. Good luck trying to resolve the issue!
@@MatthiWare Thanks for the reply. I'll try this later. It's such a strange problem. "Test Explorer" can not find the tests. I tried XUnit as well and the same thing happens.
@@MatthiWare WOOHOO! I just got got XUnit working. All I had to do after re-installing packages was to close VS and restart my computer. I think it was a combination of things, one being my CPU being overloaded. I think it's time to think about buying a new laptop for development. Thanks for your help!
Hi it seems like you are trying to access BankAccount class. You should access the instance of the BankAccount that you defined. In the tutorial this instance is called "account". If this still doesn't help you can check the complete source code and try to find what you are doing wrong: github.com/MatthiWare/UnitTesting/blob/master/BankNUnitTests/BankAccountTests.cs
Hi if you are using visual studio, go to build -> rebuild solution. After that you should be able to execute the tests! Also check the complete source code here: github.com/MatthiWare/UnitTesting
You can find the source code for the unit tests here
github.com/MatthiWare/UnitTesting/tree/starting-point
Simple but yet informative and your video covers basically all that is needed to know about NUnit Project unit testing. I was a bit confused but thanks to your tutorial, it made things more easier to understand. Keep up the good work.
Thank you!
I have been seen multiples videos for many years. This is the first one that I understand the all explanation. To be honest, you are so good doing this. Congrats!
Thank you for this tutorial. It was helpful and glad to see that this course can still be completed without errors after two years.
Thanks Man. You made it quite simple to understand & very well planned.
love the video..following the steps and actually I'm understanding what it is trying to do now.thank you! never write unit test and I'm expecting to have an interview to cover that.LOL
Good luck with the interview and I hope this video helped!
Awesome video, explanation is simple and clear
Awesome video ! for us old dinosaurs / cowboys who are now being forced to do unit testing ;-)
Use Mocking in C# .NET Unit Tests ruclips.net/video/jkzJwTbcSRg/видео.html
Great tutorial learned a lot! Thanks!
This was a great tutorial !
The best tutorial!
great introductory video! thanks!
Don't know what you are talking about? There is no NUnit for .Net Framework in VS2019 default installation. That is the part on minute 2 where you stumble upon.
exactly, thats mstest
Very usefull video, thanks.
Hi, what type of project of Bank? Is it "Class library" or "Console application"? How can I create "Console application" and link it with project of NUnit test.
I was repeating after you and create project "Bank" as "Console Application" then I create project of NUnit test, then clicked on project test and added reference to "Bank". But when I tried to create instance of "Bank" my test method didn't see Bank class
Make sure the Bank class is public and also make sure you added the namespace of the Bank class. If you still have issues you can find the complete code here: github.com/MatthiWare/UnitTesting/blob/master/BankNUnitTests/BankAccountTests.cs
@@MatthiWare thank you so much, I tried to figure out how to set it up for three days. But mistake was in directive of using, I forgot to write it in project, but actually I didn't know that I must to write it
Thank you for the information!
Hello Matthi, thank you for the wonderful video. It was very helpful to get me started. I have an issue that I find difficult to solve though. I want to run a unit test on a private method. When I Arrange the class to test on, I cannot call the private method because it is private to that class. I know I could make it public, but I would rather not do that. What could I do in Unit Testing to test a private method?
Hi, making the method public is indeed not a good idea. What you'll need to do is test the public methods that call the private methods. Best case would be that by only testing the public method(s), you also tested all possible code paths in the private method(s).
Which NUnit packages did you install. I installed "NUnit" and "NUnit3TestAdapter". When I try to run the test, nothing is displayed in the "test explorer". I'm using "VS2019 community". Can you give me any advice? Great tutorial btw!
Hi that should be correct, you can double check with the ones I used here github.com/MatthiWare/UnitTesting/blob/master/BankNUnitTests/BankNUnitTests.csproj or try out my finished project in the github repo locally and see if that works. I've also had troubles with running tests a couple of times but normally there should be an error log in the console of visual studio, you can use that message to find a solution on stackoverflow for example. Good luck trying to resolve the issue!
@@MatthiWare Thanks for the reply. I'll try this later. It's such a strange problem. "Test Explorer" can not find the tests. I tried XUnit as well and the same thing happens.
@@MatthiWare WOOHOO! I just got got XUnit working. All I had to do after re-installing packages was to close VS and restart my computer. I think it was a combination of things, one being my CPU being overloaded. I think it's time to think about buying a new laptop for development. Thanks for your help!
@@ecaepevolhturt No problem, glad I could help!
Very nice video!
I write test code for add and subtract but it's give me error can't not be access with instance reference qualify with type name what to do now
Hi it seems like you are trying to access BankAccount class. You should access the instance of the BankAccount that you defined. In the tutorial this instance is called "account". If this still doesn't help you can check the complete source code and try to find what you are doing wrong: github.com/MatthiWare/UnitTesting/blob/master/BankNUnitTests/BankAccountTests.cs
Great tutorial :)
Thank you.
hi ,
plz help me MatthiWare
How can i order tests (up to 300)
You can add a [Order(1)] attribute see: docs.nunit.org/articles/nunit/writing-tests/attributes/order.html
@@MatthiWare thanx MatthiWare
bro buy a good mic
I'm getting bank.dll could not be found error , and Adding_funds_updates_balance test is failing
How to resolve this ?
Hi if you are using visual studio, go to build -> rebuild solution. After that you should be able to execute the tests!
Also check the complete source code here: github.com/MatthiWare/UnitTesting