| |
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.
|
12 Articles match "Unit Testing"
See all articles with
"Unit Testing"
| The Latest from Maurice de Bejeir | 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. Testing for getting with an invalid ID is equally simple: 1: [TestMethod]. Testing an HTTP PUT operation. Testing an update using an HTTP put is just as simple as a testing a get action. 8: 9: }. 11: {. The Problem Solver - Sunday, May 12, 2013 DotNed Podcast: Peter Provost over unit testen In deze podcast spreekt Hassan Fadili met Peter Provost over unit testen. Links: Blog: [link] Tech-Ed sessies: [link] Team Test Blog: [link] What's new for MSTest Unit Tests in Visual Studio 11 Beta: [link] Application Lifecycle Management resource center | SharePoint 2010 [link] Test Release Management Guidance: [link] Rangers Solutions by Version [link] Compare Visual Studio 2012 editions [link] Hassan's Blog voor alle relevante VS ALM informatie: [link] Met dank aan onze sponsor RedGate. Enjoy! TechEd Podcast DotNed SharePoint UnitTesting The Problem Solver - Thursday, July 19, 2012 | | The Best from Maurice de Bejeir | 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. Testing for getting with an invalid ID is equally simple: 1: [TestMethod]. Testing an HTTP PUT operation. Testing an update using an HTTP put is just as simple as a testing a get action. 8: 9: }. 11: {. 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 Inversion of control and WCF The are lots of reasons for doing so but in the end they mostly boil down to separation of concern which makes thing more modular and thereby easier to reuse and unit test. Lots of people like to use in inversion of control container, usually shortened to IOC, to inject dependencies into classes. When you start doing so manually injecting dependencies into a types constructor is easy enough but after a while this tends to become tedious and getting an IOC container to do this for you is a lot easier. This gives us two methods, the GetData() and GetDataUsingDataContract(). Bind ().ToConstant(Kernel); The Problem Solver - Tuesday, April 19, 2011 | - DotNed Podcast: Peter Provost over unit testen
In deze podcast spreekt Hassan Fadili met Peter Provost over unit testen. Links: Blog: [link] Tech-Ed sessies: [link] Team Test Blog: [link] What's new for MSTest Unit Tests in Visual Studio 11 Beta: [link] Application Lifecycle Management resource center | SharePoint 2010 [link] Test Release Management Guidance: [link] Rangers Solutions by Version [link] Compare Visual Studio 2012 editions [link] Hassan's Blog voor alle relevante VS ALM informatie: [link] Met dank aan onze sponsor RedGate. Enjoy! TechEd Podcast DotNed SharePoint UnitTesting The Problem Solver - Thursday, July 19, 2012 - Getting started with the WCF Web API
And doing other things with the response often required us to use the static WebOperationContext.Current making out code much harder to unit test. Warning: This post is based on a prerelease version of the WCF Web API When designing services the REST style is becoming more and more popular. Not that REST is anything new, it has been around for some time. The fact that WCF supports REST services isn’t new either as the WebServiceHost and WebHttpBinding where released with the.NET framework 3.5. However the original REST support in WCF was quite limited. ServiceContract]. Enjoy! The Problem Solver - Tuesday, May 31, 2011 - Comparing two Uri’s
So the following unit test passes even though I would have expected it to fail! This one bit me today a bit unexpectedly. was comparing two Uri’s and was getting unexpected matches between two Uri’s that where quite clearly not the same. Turns out the when comparing Uri’s the Fragment, or anchor or part after the #, is not part of the comparison. TestMethod]. public void TestTwoEqualUrisWithDifferentAnchorShouldNotBeEqual(). {. Note that when comparing uri1 and uri2 they are equal even though they use two different anchor tags. Wasted another bit of time on this piece of trivia. The Problem Solver - Friday, November 13, 2009 - Using ASP.NET MVC
The main difference is that ASP.NET MVC lends itself very well to test driven development. Now I not a pure TDD zealot but covering a lot of the code with unit test, regardless if you create the test first or later, is pretty much a requirement of a good software project. And ASP.NET MVC lend itself much better to unit testing than ASP.NET web forms. Recently I started using ASP.NET MVC for a real project. SO far I had been reluctant to use ASP.NET MVC as it meant giving up on the post back model that so many of the available ASP.NET controls depend on. The Problem Solver - Thursday, August 13, 2009 - DotNed Podcast: Peter Provost over unit testen
In deze podcast spreekt Hassan Fadili met Peter Provost over unit testen. Links: Blog: [link] Tech-Ed sessies: [link] Team Test Blog: [link] What's new for MSTest Unit Tests in Visual Studio 11 Beta: [link] Application Lifecycle Management resource center | SharePoint 2010 [link] Test Release Management Guidance: [link] Rangers Solutions by Version [link] Compare Visual Studio 2012 editions [link] Hassan's Blog voor alle relevante VS ALM informatie: [link] Met dank aan onze sponsor RedGate. Enjoy! TechEd Podcast DotNed SharePoint UnitTesting The Problem Solver - Thursday, July 19, 2012 - Getting started with the WCF Web API
And doing other things with the response often required us to use the static WebOperationContext.Current making out code much harder to unit test. Warning: This post is based on a prerelease version of the WCF Web API When designing services the REST style is becoming more and more popular. Not that REST is anything new, it has been around for some time. The fact that WCF supports REST services isn’t new either as the WebServiceHost and WebHttpBinding where released with the.NET framework 3.5. However the original REST support in WCF was quite limited. ServiceContract]. Enjoy! The Problem Solver - Tuesday, May 31, 2011 - Inversion of control and WCF
The are lots of reasons for doing so but in the end they mostly boil down to separation of concern which makes thing more modular and thereby easier to reuse and unit test. Lots of people like to use in inversion of control container, usually shortened to IOC, to inject dependencies into classes. When you start doing so manually injecting dependencies into a types constructor is easy enough but after a while this tends to become tedious and getting an IOC container to do this for you is a lot easier. This gives us two methods, the GetData() and GetDataUsingDataContract(). Bind ().ToConstant(Kernel); The Problem Solver - Tuesday, April 19, 2011 %>
102 Articles match "Unit Testing"
See all articles with
"Unit Testing"
| The Latest from DevelopMentor | MORE | | Testing triangles, pyramids and circles, and UAT 'A few months ago Markus Gartner introduced me to the Testing Triangle, or Testing Pyramid. It looks like this: If you Google you will find a few slightly different version and some go by the name of Testing Pyramid. This triangle is actually pretty similar to a diagram I’ve been drawing for a while when I do Agile training: But it occurs to me the triangle should be pushed to the side, and when you do that you can add some axis which add more information: At the base the, Unit Tests, there are lots and lots of tests and they typically execute in milliseconds. Allan Kelly's Blog - Friday, May 24, 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 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. Testing for getting with an invalid ID is equally simple: 1: [TestMethod]. Testing an HTTP PUT operation. Testing an update using an HTTP put is just as simple as a testing a get action. 8: 9: }. 11: {. The Problem Solver - Sunday, May 12, 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 - Unit Testing Coming to a Workflow Near You
[Update: See the follow up post "Significant Advances in Unit Testing Windows Workflow" ]. However you won't find very much support for Test Driven Development (TDD) or unit testing in general. In fact the architecture that makes Windows Workflow powerful (strict separation of workflow, activities, and the host for example) really gets in the way of unit tests. There has been some work done on unit testing Windows Workflows. Here's some links: Unit Testing Activities with Windows Workflow Foundation by Ron Jacobs. Michael C. Kennedy's Weblog - Tuesday, September 30, 2008 - 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. 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. Tags: DevelopMentor Screencasts Talks Unit Testing Michael C. Kennedy's Weblog - Wednesday, October 28, 2009 - Test-Driven Cameras
wish people had this same reaction to the idea of writing code without first writing tests (TDD). Tests give you the chance: To see what you are going to write, BEFORE you write it. If you haven’t already, here’s a great place to start learning to Test-Driven Development ? If you are already writing tests, here’s a free library to make test even easier to write? Unit Testing TDDI am getting old. The other day I was hanging around with my friend, Ike Ellis. He told me a story about his kids. The first question they asked was “Where is the picture?” DevelopMentor Courses - Wednesday, September 7, 2011 %>
| | |