| |
browse.develop.com
Browse.develop.com is a community that was established to collect and
organize valuable web information. Our technical staff have selected and
indexed information and courses that they feel will help you stay
current on best practices across the SDLC.
|
25 Articles match "Methods","Unit Testing"
| Related DevelopMentor Courses | MORE | | Unit testing a ASP.NET WebAPI controller Testing a simple ApiController that gets data Suppose we have the following ASP.NET WebAPI Controller with two Get methods, the first returns the complete list of books and the second returns the book with the requested ID. Testing the Get() method. The Get() method that returns all books is easy enough to test. Testing the Get(id) method. This results in that the ApiController method uses the Request property to create a new HttpResponseMessage with the specific HTTP status code. Testing an HTTP PUT operation. 8: 9: }. The Problem Solver - Sunday, May 12, 2013 Unit testing code depending on the ASP.NET #WebApi HttpClient 'In a previous post I showed how to unit test an ASP.NET WebAPI Controller. Assuming for a moment the client part is also written in C# we should test that as well. Testing the BooksClient class. If we want to test this class we need to pass in an HttpClient object. This might not sound like a big deal but as this class doesn’t implement an interface we can’t use most of the standard mocking frameworks like Moq to replace the HttpClient with a test fake. Testing the GetBooks() function. test is pretty simple. Testing am HTTP POST action. The Problem Solver - Monday, May 20, 2013 Testing Difficult Code I recently did 3 videos in my ‘ Using ApprovalTests in.Net’ series that deal with how to test difficult code. These video actually have very little to do with either.Net or ApprovalTests, but they are common issues you run into when unit testing. Seams Testing difficult Code comes down to 2 things: Can I call the Method? Will the Method run to completion? The Peel The hardest part about long methods is you have to run all of it to test even a small part of it. The idea behind the peel is to break the method up into easy to run pieces. DevelopMentor Courses - Wednesday, March 21, 2012 |
41 Articles match "Methods","Unit Testing"
| The Latest from DevelopMentor | MORE | | Unit testing code depending on the ASP.NET #WebApi HttpClient 'In a previous post I showed how to unit test an ASP.NET WebAPI Controller. Assuming for a moment the client part is also written in C# we should test that as well. Testing the BooksClient class. If we want to test this class we need to pass in an HttpClient object. This might not sound like a big deal but as this class doesn’t implement an interface we can’t use most of the standard mocking frameworks like Moq to replace the HttpClient with a test fake. Testing the GetBooks() function. test is pretty simple. Testing am HTTP POST action. The Problem Solver - Monday, May 20, 2013 Unit testing a ASP.NET WebAPI controller Testing a simple ApiController that gets data Suppose we have the following ASP.NET WebAPI Controller with two Get methods, the first returns the complete list of books and the second returns the book with the requested ID. Testing the Get() method. The Get() method that returns all books is easy enough to test. Testing the Get(id) method. This results in that the ApiController method uses the Request property to create a new HttpResponseMessage with the specific HTTP status code. Testing an HTTP PUT operation. 8: 9: }. The Problem Solver - Sunday, May 12, 2013 11 Agile Myths and 2 Truths Agile Myths Agile is new : No, the Agile manifesto was published in 2001, the Scrum Pattern language was works hoped at PLoP 1998, the Episodes pattern language (the forerunner of XP) was workshopped at PLoP 1995, Tom Gilb’s Evo method dates back to 1976 and there are some who trace things back further. Granted retrofitting automated unit tests is harder but it is far from insurmountable. I deliver a lot of Agile training courses and I give a lot of talks about Agile ( BCS Bristol tonight ). Consequently I spend my time debunking these myths again and again. Allan Kelly's Blog - Tuesday, February 26, 2013 | -
| The Best from DevelopMentor | MORE | - Significant Advances in Unit Testing Windows Workflow
This post describes a unit testing library for testing Windows Workflow Foundations. Rather it's a library that can be used in conjunction with any of these testing frameworks. Download the library with sample test project here: Kennedy.WorkflowTesting.zip (216 KB). First a Little History: Last September I posted this teaser entitled Unit Testing Coming to a Workflow Near You. In that previous post, I highlighted what I could determine to be the current state-of-the-art with regard to unit testing workflows, circa September 2008. Michael C. Kennedy's Weblog - Sunday, January 18, 2009 - Article: Avoiding 5 Common Pitfalls in Unit Testing
Llewellyn Falco and I recently wrote an article for DevelopMentor's Developments newsletter entitled Avoiding 5 Common Pitfalls in Unit Testing. Avoiding 5 Common Pitfalls in Unit Testing. When I started out with unit tests, I was enthralled with the promise of ease and security that they would bring to my projects. In practice, however, the theory of sustainable software through unit tests started to break down. Unit Tests have become more trouble than they are worth.". When tests would stop working, we just ignored them. Michael C. Kennedy's Weblog - Thursday, August 6, 2009 - TDD Invades Space Invaders
As a follow-up to our " Avoiding 5 Common Pitfalls in Unit Testing " article we did a webcast where we took a problem from the audience and solved it live and unrehearsed on stage. The thing to remember is that all of this was done for the sole purpose of creating a recipe for a scenario we could test. Create a new test project. Paste that method above. We made it to step 4 during our presentation (download code below) and estimate another 15 minutes would have had the whole scenario done, tested, and well-factored. This is OK. tank shoots // 5. win }. Michael C. Kennedy's Weblog - Wednesday, October 28, 2009 - Unit testing a ASP.NET WebAPI controller
Testing a simple ApiController that gets data Suppose we have the following ASP.NET WebAPI Controller with two Get methods, the first returns the complete list of books and the second returns the book with the requested ID. Testing the Get() method. The Get() method that returns all books is easy enough to test. Testing the Get(id) method. This results in that the ApiController method uses the Request property to create a new HttpResponseMessage with the specific HTTP status code. Testing an HTTP PUT operation. 8: 9: }. The Problem Solver - Sunday, May 12, 2013 - Unit testing code depending on the ASP.NET #WebApi HttpClient
'In a previous post I showed how to unit test an ASP.NET WebAPI Controller. Assuming for a moment the client part is also written in C# we should test that as well. Testing the BooksClient class. If we want to test this class we need to pass in an HttpClient object. This might not sound like a big deal but as this class doesn’t implement an interface we can’t use most of the standard mocking frameworks like Moq to replace the HttpClient with a test fake. Testing the GetBooks() function. test is pretty simple. Testing am HTTP POST action. The Problem Solver - Monday, May 20, 2013 - Testing Difficult Code
I recently did 3 videos in my ‘ Using ApprovalTests in.Net’ series that deal with how to test difficult code. These video actually have very little to do with either.Net or ApprovalTests, but they are common issues you run into when unit testing. Seams Testing difficult Code comes down to 2 things: Can I call the Method? Will the Method run to completion? The Peel The hardest part about long methods is you have to run all of it to test even a small part of it. The idea behind the peel is to break the method up into easy to run pieces. DevelopMentor Courses - Wednesday, March 21, 2012 - Keep Dependency Injection Simple with MEF
Having to click through screens to test an application can be tedious and time-consuming, and it may not provide good code coverage or regression testing. By abstracting the View into a separate ViewModel, you can independently test the ViewModel to make sure it behaves as expected. The unit testing framework is simple another consumer of the View-Model. Whether or not you subscribe to the tenants of Test-Driven Development (TDD), you should test your ViewModels without any dependency on WCF services or databases. Enter Dependency Injection ! Tony and Zuzana's World - Tuesday, March 8, 2011 %>
| | |