Posts

Showing posts from February, 2011

Visual Studio 2010: Find and Replace using Regular Expressions

Image
Spanish version / Versión en Español This is not something introduced by Visual Studio 2010, but I'm a late bloomer. I'm quite sure that at least 2008 and 2005 also have it. Let's say we have a test class which opens a bunch of files, and that it has a lot of hardcoded relative paths like this: class FactoryImage{ public static IEnumerable ImageTestCases{ get{ //9 bits, Signed, Monochrome1 yield return new TestCaseData(new ImageParameters { FileName = ".\\ImagesTest\\DavidClunie\\MONOCHROME1\\Signed\\9SignedMonochrome1_512x512_LE.pix", //Rawdata, example image FileNameWhite = ".\\ImagesTest\\DavidClunie\\MONOCHROME1\\Signed\\9SignedMonochrome1_512x512_LEWhiteImage.pix", //Rawdata, white example image //More fields... }); //9 bits, Unsigned, Monochrome1 yield return new TestCaseData(new ImageParameters{ FileName = ".\\ImagesTest\\Da

Visual Studio 2010: Find and Replace con Expresiones Regulares

Image
Versión en inglés / English version Esto lo tienen versiones anteriores al Visual 2010, pero uso la referencia del 2010, así que aclaro por si las moscas. Supongamos que tenemos una clase de test que abre un conjunto de archivos, y que tiene un montón de paths relativos hardcodeados de esta forma: class FactoryImage{ public static IEnumerable ImageTestCases{ get{ //9 bits, Signed, Monochrome1 yield return new TestCaseData(new ImageParameters { FileName = ".\\ImagesTest\\DavidClunie\\MONOCHROME1\\Signed\\9SignedMonochrome1_512x512_LE.pix", //Rawdata, example image FileNameWhite = ".\\ImagesTest\\DavidClunie\\MONOCHROME1\\Signed\\9SignedMonochrome1_512x512_LEWhiteImage.pix", //Rawdata, white example image //Otros atributos... }); //9 bits, Unsigned, Monochrome1 yield return new TestCaseData(new ImageParameters{ FileName = ".\\ImagesTest\\DavidCluni