Geeks With Blogs

News profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Donate Bitcoins

Check out Elapser from T3rse!

Programming and Learning from SD Unit Testing
FakeItEasy and EntityFramework
We needed to fake or mock out Entity Framework so that we could test our “service layer” that holds our business logic without hitting a real database. We are using EF as our Repository and skipping all the extra work in creating a repository code layer that only wraps EF. We are ok with being this closely tied to EF. It was difficult to figure out how to fake the context with an interface we made ourselves. We found some helpful Nuget packages, so I decided to share it. EntityFramework.Testing: ......

Posted On Friday, November 20, 2015 9:11 PM

Using Visual Studio Online's new build system to achieve a Continuous Delivery pipeline Presentation
I had the honor and pleasure of giving my first presentation at an event at South Dakota Code Camp last weekend on November 7th. Thanks to the organizers and sponsors, I’m looking forward to next year already. I talked about the importance of Continuous Delivery in today’s development practices and how it helps us get quality code to our users quicker and more reliably using automated processes. Microsoft’s build system has improved immensely in the last year and one of my goals was to show what ......

Posted On Tuesday, November 10, 2015 4:10 PM

Cleanup your TestResults folder with a Scheduled Task
I run automated UI test with Selenium (unit testing will do this as well, though not as many files) from the Visual Studio Test Explorer a lot. This creates a new folder inside of my solution location named TestResults for every test run. Depending on what I need to deploy for the test (Selenium chrome driver, images, dlls, etc) the size of that it takes up on my hard drive gets very large after a few weeks. I’ve deleted gigs before. In the spirit of “if you do something more than once, automate ......

Posted On Tuesday, January 13, 2015 5:04 PM

Quick Guide to setup a MVC project for Unit Testing
A barrier to getting into writing executable tests (Unit Tests, integration tests, automated UI tests, etc) with some people I work with, is not knowing how to get started. I believe the desire and the recognition of the value and importance of this testing is growing, but I want to help people get over that hump. Read the MSDN Unit Testing MVC article. consider splitting controllers into a different project as suggested Don’t put your data access code inside the Controller methods, use a data layer/object. ......

Posted On Thursday, September 25, 2014 9:18 PM

Checking the Status of a Cloud Service with Azure Management API
We are automatically deploying a package to Azure, then running tests against that instance. See Brady Gaster’s article for more details. I needed a way to make sure the deployment was complete, and if not wait for it. After digging through the objects with Intellisense, we found this solution:public bool IsCloudServiceRunning() { var details = _computeManagementClient.Ho... var deployment = details.Deployments.First(d => d.Name == _parameters.CloudServiceName ......

Posted On Thursday, September 18, 2014 12:37 PM

Dependency Injection Interview Video
In the video from Visual Studio Magazine with Miguel Castro who has some interesting things to say about Dependency Injection and Unit Testing. "It should be mainstream". "no longer do we new objects up, now = new this()". "this [new objects] used to be a no-brainer... until all of a sudden Unit testing hit the world by storm" "#1 reason for this is so we can test properly""You're writing untestable code [without DI]" "I'm a consultant, so I need to leave something maintainable and tested" ~ talking ......

Posted On Thursday, September 19, 2013 4:05 PM

Benefits of Behavior Driven Development
Continuing my previous article on BDD, I wanted to point out some benefits of BDD and since BDD is an extension of Test Driven Development (TDD), you get those as well. I’ll add another article on some possible downsides of this approach. There are many articles about the benefits of TDD and they apply to BDD. I’ve pointed out some here and copied some of the main points for each article, but there are many more including the book The Art of Unit Testing by Roy Osherove. ......

Posted On Friday, July 26, 2013 10:44 AM

Get a new instance with StructureMap
It took me too long to figure this out, so hopefully it will help you. StructureMap has way that will create a new instance of the object every time, instead of storing this in the container. I’m going to use this for the DBContext and for WCF Service references. Since the ObjectFactory is a static class, MVC will have these stored in memory without this. Credit goes to Joshua Flanagan for answering my question.[TestMethod] public void GetConcreteInstanceOf_Shoul... { ObjectFactory.Initialize(re... ......

Posted On Thursday, November 29, 2012 10:44 AM

Mock the window.setTimeout in a Jasmine test to avoid waiting
Jasmine has a clock mocking feature, but I was unable to make it work in a function that I’m calling and want to test. The example only shows using clock for a setTimeout in the spec tests and I couldn’t find a good example. Here is my current and slightly limited approach. If we have a method we want to test: var test = function(){ var self = this; self.timeoutWasCalled = false; self.testWithTimeout = function(){ window.setTimeout(function(){ self.timeoutWasCalled = true; }, 6000); }; }; Here’s ......

Posted On Thursday, August 21, 2014 4:42 PM

Getting Started with Behavior Driven Development
In this post, I wanted to share some thoughts and resources that I’ve collected since learning about Behavior Driven Development (BDD) (as of June 2013). Thinking in BDD terms has really helped me in improving my software development and thinking through problems. I remember a day when it clicked. It was an exciting time for me and I don’t planning on going back to the old approach. My tendency is to dive into the code before thinking through things and that gets me into trouble. I’m also an optimistic ......

Posted On Tuesday, June 11, 2013 10:18 AM

Copyright © Aligned | Powered by: | Join free