Category: Unit Testing

7 Key Decisions for Any New Xamarin Project

While there is no shortage of information out there to help you get started with Xamarin, making the most of the right tools and established best practices can really kickstart your development efforts.

On any new project you’ll face some key questions such as: Xamarin.Forms or Native UI? What architecture and/or frameworks are appropriate? How should I persist the state of my applications? What is the best tooling to test, build and deploy my apps? The choices you make here can be the difference between making a real impact in the early stages of your project and being left reinventing the wheel.

Continue reading “7 Key Decisions for Any New Xamarin Project”


Talk: Test Automation in Practice with Xamarin Test Cloud

This is a talk I did for the SWmobile group with Kevin West back in February 2016. The practical advice from the talk is covered in 5 Common Pitfalls of UI Test Automation.

Why do UI Automation projects often fail? With many automated test frameworks, getting started with your first few tests is the easy part. Building a sustainable, flexible test suite that gives you valuable data on the quality of your applications can be daunting to say the least.

Let us take you from those first few tests to an end-to-end BDD process that has become part of our everyday work. Discover how having rejected the idea of a dedicated QA team, the core development team take responsibility for quality and invest in a process that delivers value for them.

Learn how Test Cloud solves many of the issues that typically derail automation projects, how to handle ongoing maintenance, how to maximise test reuse between platforms and how adopting the Page Object pattern can help build test cases that can handle even a complete UI redesign with ease.

From CI to CD with Risk-Based Regression Testing

Having adopted Continuous Integration to build applications multiple times a day, it can be a struggle to find a testing strategy that gives teams the confidence to move to Continuous Delivery. Typically they start out with the aim of automating all tests, but this can be an unrealistic and unhelpful goal.

For a complex application, it is unlikely that automating all test cases for every build is the most effective approach. A risk-based mindset for your regression testing can help you to decide which gaps in your testing – if any – are acceptable.

Continue reading “From CI to CD with Risk-Based Regression Testing”

An OO Application Technical Test Strategy

As the Test Pyramid tells us, unit and integration tests should make up the bulk of our test strategy. But where we draw the line between the two, how they complement each other and their relationship with our acceptance tests can be a source of confusion.

Building on my Hexagonal Architecture series of posts, I’ll walkthrough an example that outlines my usual strategy for technical tests by building the test configuration of a Ports and Adapters application.

Continue reading “An OO Application Technical Test Strategy”

Automatically Generating NUnit Test Cases

I recently came across a need to populate the TestCase attribute of an NUnit test case programatically.
In case you’re not familiar with TestCase, here’s an example:

    [TestCase(1, 1, 2)]
    [TestCase(1, 2, 3)]
    [TestCase(2, 2, 4)]
    public void APlusBEqualsC(int a, int b, int c)
        Assert.AreEqual(c, a + b, $"Expected {a} + {b} = {c}");

As is hopefully clear from the sample above, TestCase lets you vary the inputs to an NUnit test method while reusing the test code itself.
For each TestCase attribute supplied, a new test is created using the supplied parameter list.

But what if you want to generate these TestCase attributes through code?

Continue reading “Automatically Generating NUnit Test Cases”