| |
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.
|
6 Articles match "Behavior","Unit Testing"
| Related DevelopMentor Courses | MORE | | 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. Particularly with WCF, where you need other pieces (such as an instance provider, service behavior and service host), the abstraction afforded by the Common Instance Factory provides a uniform way to deal with different DI containers so that swapping out one for another is much easier. GreetingService doesn’t care how IGreetingRepository is implemented. DevelopMentor Courses - Wednesday, May 23, 2012 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. This behavior happens to be missing from Ninject’s WCF extension, but CIF provides the correct implementation.). null ) { disposable.Dispose(); } } } } }. Enjoy. Technical DI WCF DevelopMentor Courses - Saturday, May 26, 2012 Code Smarter with a Day of Design Patterns Training The strategy and template patterns allow us to build solutions that can evolve without the risk of effecting existing well tested code. ? This is essential for effective unit testing.? This will allow us to combine a variety of behaviors far more efficiently that normal inheritance.? Why use Design Patterns Strategy and Template Creation Patterns State Decorator Reuse solutions, not just code. Code Smarter with Design Patterns helps you identify problems that occur repeatedly in your code, and solve those problems in a standardized way. DevelopMentor Courses - Friday, March 23, 2012 |
19 Articles match "Behavior","Unit Testing"
| The Latest from DevelopMentor | 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. This behavior happens to be missing from Ninject’s WCF extension, but CIF provides the correct implementation.). null ) { disposable.Dispose(); } } } } }. Enjoy. Technical DI WCF 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. Particularly with WCF, where you need other pieces (such as an instance provider, service behavior and service host), the abstraction afforded by the Common Instance Factory provides a uniform way to deal with different DI containers so that swapping out one for another is much easier. GreetingService doesn’t care how IGreetingRepository is implemented. DevelopMentor Courses - Wednesday, May 23, 2012 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. The Web.Ui Enjoy. Tony and Zuzana's World - Saturday, October 8, 2011 | -
| 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. 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 - Unity, Multiple Constructors and Configuration
However to make Unit Testing simple I’ll add another constructor to MyService so I can pass a specific timeout. This is caused by Unity’s default behavior where it will try to resolve on the constructor with the most parameters (on the basis that this one will have the most dependencies that can be injected). Tags: NET;IoC;Unit Testing I’ve been working with the Unity IoC container from Microsoft Patterns and Practices recently. Lets start off with a simple example: I have two interfaces: IService and IRepository that live in the Interfaces class library. .NET Meanderings - Monday, June 7, 2010 - Why Write Unit Tests?
Why Write Unit Tests? I've made a small video to go with this post Approval Tests have allowed us to focus on the parts of testing at a much higher level of abstraction. The benefits of Automated Tests are one of the areas that we can now more clearly appreciate. There are 4 main areas programmers can benefit from using Automated Tests (Unit and otherwise) Specifications Feedback Regression Granularity Let's talk about each of these. Well, you can't do better than a running, failing unit test. First, there is Specifications. - 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. This leaves just one change to make and that is to specify the service factory what will wire up the required WCF behavior and that is added to the Service1.svc file. Lots of people like to use in inversion of control container, usually shortened to IOC, to inject dependencies into classes. Basically WCF uses an implementation of the IInstanceProvider to create new service objects. repo = repo; }. Enjoy! The Problem Solver - Tuesday, April 19, 2011 - 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 %>
| | |