| |
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.
|
11 Articles match "Unit Testing"
See all articles with
"Unit Testing"
| The Latest from Tony and Zuzana's World | MORE | | Decouple WCF Services from their DI Container with Common Instance Factory And I would certainly not use CIF for unit tests (or even some integration tests), where you need to leverage features of the DI container that are not exposed via the factory interface. In this case, you might want to use a super-fast DI container, such as SimpleInjector , for the application while leveraging a full-featured DI container, just as Ninject , for unit testing. Unlike the Common Service Locator (CSL), the Common Instance Factory (CIF) discourages the service location anti-pattern by using the abstract factory design pattern. Enjoy. DevelopMentor Courses - Saturday, May 26, 2012 Use Common Instance Factory to Abstract Away the Dependency Injection Container lot of DI-specific code is needed for unit tests, where there is extensive mocking, and advanced features of a DI container such as Ninject come in handy. Here is a unit test that demonstrates the usage. Download the Common Instance Factory with WCF Extensions here and is also available on NuGet. while back I wrote a blog post on the Onion Architecture , an approach to building loosely-coupled applications where you can swap out particular components without affecting the rest of the application. GreetingService doesn’t care how IGreetingRepository is implemented. DevelopMentor Courses - Wednesday, May 23, 2012 Screening C# Candidates: Let’s Play 20 Questions! For example, someone might be called upon to build a WPF app retrieving data from a WCF service that queries a SQL database using Entity Framework with Ninject for dependency injection and MOQ for unit testing. The only way to test for those things is to perform an in-depth technical interview performed by a senior technical specialist. Over the past year I was involved in the process of interviewing candidates for both mid and senior level developer positions. Furthermore, I’m looking for a developer with a thirst for knowledge. C# Phone Screen Questions (without Answers). DevelopMentor Courses - Tuesday, February 28, 2012 | | The Best from Tony and Zuzana's World | MORE | | Peeling Back the Onion Architecture MVC (which stands for Model-View-Controller) lends itself to an Agile development methodology where TDD and BDD (Test-Driven and Behavior-Driven Development) are important components. Writing applications that are testable requires that you separate business logic from presentation logic so that they can be independently tested. Representing your repositories and services as interfaces decouples consumers from concrete implementations, enabling you to swap one out for another without affecting consumers, such as client UI’s or tests. Download the code for this article. Tony and Zuzana's World - Saturday, October 8, 2011 Screening C# Candidates: Let’s Play 20 Questions! For example, someone might be called upon to build a WPF app retrieving data from a WCF service that queries a SQL database using Entity Framework with Ninject for dependency injection and MOQ for unit testing. The only way to test for those things is to perform an in-depth technical interview performed by a senior technical specialist. Over the past year I was involved in the process of interviewing candidates for both mid and senior level developer positions. Furthermore, I’m looking for a developer with a thirst for knowledge. C# Phone Screen Questions (without Answers). DevelopMentor Courses - Tuesday, February 28, 2012 Simple MVVM Toolkit versus MVVM Light Toolkit 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. Lastly, Simple MVVM has direct support for dependency injection with MEF (Managed Extensibility Framework) and unit testing (for example with the Silverlight Unit Testing Framework). When it comes to deciding which toolkit best suites your needs, there is a spectrum of choices. Tony and Zuzana's World - Saturday, April 23, 2011 | - 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 - Use Common Instance Factory to Abstract Away the Dependency Injection Container
lot of DI-specific code is needed for unit tests, where there is extensive mocking, and advanced features of a DI container such as Ninject come in handy. Here is a unit test that demonstrates the usage. Download the Common Instance Factory with WCF Extensions here and is also available on NuGet. while back I wrote a blog post on the Onion Architecture , an approach to building loosely-coupled applications where you can swap out particular components without affecting the rest of the application. GreetingService doesn’t care how IGreetingRepository is implemented. DevelopMentor Courses - Wednesday, May 23, 2012 - Tackling the Problem of Modal Dialogs in MVVM
It is notoriously difficult to test the user interface by simulating things like button clicks and mouse overs. Encapsulating functionality into a view-model means that you can test it independently of the view, which is just another consumer of the view-model. If you were to display a dialog from the view-model in order to get input from the user, it would be impossible to run a unit test against the view-model because there’s no way for a unit test to respond to the dialog. One of the main benefits of MVVM is better application maintainability. null). Tony and Zuzana's World - Friday, January 28, 2011 - Build a Multi-Project Visual Studio Template
good example is the SimpleMvmRiaServices project template shown in the first screenshot, which generates a Visual Studio solution with three projects: an ASP.NET Web project, a Silverlight client project, and a Test project for unit tests. Next, make sure to sign your wizard assembly, using a test certificate if you like, and then obtain the public key token by opening a Visual Studio command prompt at the location of your wizard dll and entering the command (replace WizardAssembly with your dll file name): sn –T WizardAssembly.dll. saferootprojectname$.Entities Tony and Zuzana's World - Wednesday, September 14, 2011 - 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. Use the SimpleMvvmViewModelTests item template to add a unit test for the ViewModel to the Test project. Great news! You can also download the code for the tutorial and read the tutorial. Enjoy Tony and Zuzana's World - Thursday, April 28, 2011 - Decouple WCF Services from their DI Container with Common Instance Factory
And I would certainly not use CIF for unit tests (or even some integration tests), where you need to leverage features of the DI container that are not exposed via the factory interface. In this case, you might want to use a super-fast DI container, such as SimpleInjector , for the application while leveraging a full-featured DI container, just as Ninject , for unit testing. Unlike the Common Service Locator (CSL), the Common Instance Factory (CIF) discourages the service location anti-pattern by using the abstract factory design pattern. Enjoy. DevelopMentor Courses - Saturday, May 26, 2012 - Simple MVVM Toolkit: Feature Rich with WPF and WP7 Support
I’ve rounded out the feature set of my Simple MVVM Toolkit to include a Message Bus (also known as an event aggregator or mediator ) for loosely coupled communication among view-models and to support MEF (Managed Extensibility Framework0 for dependency injection (also known as inversion of control) of service agents to better enable unit testing of view-models. would like to complete another version of the end-to-end sample in order to futher demonstrate using the Message Bus with page navigation and dependency injection for unit testing. What’s next? Tony and Zuzana's World - Friday, February 4, 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 %>
| | |