Categories
Automation Programming

Use PowerShell to Send All Regex Matches to a New File

Yesterday I had to look at a list of stuff on a third-party website and match it up to a list of stuff we control. It took quite a bit of time and some Excel shenanigans to complete the task and as I know it’s going to crop up again, I decided to employ PowerShell […]

Categories
Programming

Inserting Soft Hyphens into a String Just Before Capital Letters

I am currently working on a open source project that involves the display of lots of .NET file names within flexible tiles (the tiles are sized based on the display). It is a pretty common scenario to have reasonably long file names that won’t fit nicely on a tile. For example, CustomerEntitlementRepository.cs needs a pretty […]

Categories
Programming

Useful SpecFlow Regular Expressions

Here are some useful regular expressions that can improve your SpecFlow step definitions. All of the examples are ready to drop-in to a  C# string, so they are pre-escaped for your pleasure (for example, the useful RegEx ([^\”]*) is listed as “”([^\””]*)”” so you can use it in a definition like this: [Given(@”this line accepts […]

Categories
Programming

Overloaded Steps In SpecFlow

This can be a pretty common situation in SpecFlow, thanks to the trusty default RegEx that SpecFlow uses: Scenario: Binding Test Given I have defined a step for the second line of this specification, but not the third And this line accepts “a string” in And this line accepts “a string” in and “another string” […]