| |
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.
|
20 Articles match "Functionality","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. If we just call this method we will receive an ArgumentNullException in the CreateResponse() function. Testing for getting with an invalid ID is equally simple: 1: [TestMethod]. Testing an HTTP PUT operation. 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. The most important function is the SendAsync() which returns a new Task. 14: {. 21: {. 29: {. The Problem Solver - Monday, May 20, 2013 Guerrilla.NET (UK) Training Create robust code using unit testing frameworks and mocking Simplify your service deployment with zero config services with WCF 4.0. Write modern web applications that are simpler to unit test with ASP.NET MVC. Unit Testing Using unit testing comprehensively within software development is a growing movement. Unity testing allows refactoring and maintenance with the confidence that existing functionality is not broken. Leverage new features of C# 4.0, including named and optional parameters and dynamic typing. couldn't? DevelopMentor Courses - Tuesday, March 1, 2011 |
34 Articles match "Functionality","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. The most important function is the SendAsync() which returns a new Task. 14: {. 21: {. 29: {. Maurice de Bejeir - Monday, May 20, 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. The most important function is the SendAsync() which returns a new Task. 14: {. 21: {. 29: {. 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. If we just call this method we will receive an ArgumentNullException in the CreateResponse() function. Testing for getting with an invalid ID is equally simple: 1: [TestMethod]. Testing an HTTP PUT operation. Maurice de Bejeir - Sunday, May 12, 2013 | -
| The Best from DevelopMentor | MORE | - 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 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. If we just call this method we will receive an ArgumentNullException in the CreateResponse() function. Testing for getting with an invalid ID is equally simple: 1: [TestMethod]. Testing an HTTP PUT operation. 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. The most important function is the SendAsync() which returns a new Task. 14: {. 21: {. 29: {. The Problem Solver - Monday, May 20, 2013 - Screencast: Real-World MVVM with WCF RIA Services
The tutorial also demonstrates how to build unit tests against a ViewModel and run them asynchronously. The template creates a solution with three projects : a Silverlight project, a Unit Testing project, and a Web Host project. The Silverlight and Test projects reference the Simple MVVM Toolkit and contain all the required classes. Just press F5 to see a fully functional MVVM application. Use the SimpleMvvmViewModelTests item template to add a unit test for the ViewModel to the Test project. Great news! Enjoy Tony and Zuzana's World - Thursday, April 28, 2011 - Testing Asp.Net pages
Here is the strategy I’ve been using for unit testing Asp.Net pages. Aspx pages were almost intentionally made to be hard to test, so the result is as elegant as is possible for the given situation. Note : If you want to test something that isn’t the “end result” of a web page, simply pull that logic into a separate classmethoddll and test it normally. This is for testing the final output of the page. The Bottom Line : The following 1 line will test the AspxClass for a given scenario. Step 4) Turn on the local test server and then run the tests. DevelopMentor Courses - Sunday, July 3, 2011 - Using Excel for VSTS Data Driven Testing
A colleague of mine, Kev Jones , has posted some information on using a detached SQL Server database for driving VSTS unit tests which works great if you need a full blown SQL implementation. The equivalent unit test might look something like: [TestMethod]. This code just tests a specific case -- I would also need to write other unit tests for edge cases and exceptional cases. can do this several different ways I could do this: 1) Write a unit test for each specific case passing each value and testing the expected result. - Simple MVVM Toolkit versus MVVM Light Toolkit
Both toolkits come with three assemblies offering basically the same functionality, each targeted to a different platform. Part 1 has basic functions and shows how to use events for dialogs and two-way communication between Views and ViewModels. Part 2 demonstrates navigation, messaging, dependency injection, unit testing and async operations. In addition Simple MVVM includes a multi-project Visual Studio template that supplies a Silverlight client, a WCF RIA Services web host, and a Unit Testing project. Platforms. Support. Usability. That’s it. Enjoy. Tony and Zuzana's World - Saturday, April 23, 2011 %>
| | |