TLDR; 1. Setup the Karma Trx Reporter. 2. Add Publish Results Build Step using ../TestResults/**/karma-tes... as the path. 3. If remote Vm for Jasmine tests, copy the .trx file to the Results directory. Our team has been using JasmineJs for unit testing our client side JavaScript code. We now have over 3,000 tests! In order to run these tests on multiple browsers we useKarma, the "Spectacular Test Runner for JavaScript" created by people from Google to run all our tests on multiple browsers. ......
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: ......
Please visit me and read this article at AlignedDev.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 ......
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 ......
Reposted on my new blog. Come visit me there!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 ......
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 ......
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 ......
Now posted on aligneddev.netContinuing 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. ......
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 ......
I've re-posted on my [new blog](https://aligneddev.ne... 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. ......
Full Unit Testing Archive