Easily replacing Assert.IsTrue statements

I blogged/ranted about Assert.IsTrue previously, well today I decided to work out a quick way to do bulk conversions of tests.
Well the easiest way to go about this is using a good old Regular Expression:
Assert\.IsTrue\((?<Actual>.*)\s*==\s*(?&l…


This content originally appeared on Posts on LINQ to Fail and was authored by Posts on LINQ to Fail

I blogged/ranted about Assert.IsTrue previously, well today I decided to work out a quick way to do bulk conversions of tests. Well the easiest way to go about this is using a good old Regular Expression: Assert\.IsTrue\((?<Actual>.*)\s*==\s*(?<Expected>.*)\) That’s a regex which is ideal for using from Visual Studio, or any other tool that supports named capture groups. If you don’t have something like that you can use numerical capture groups:


This content originally appeared on Posts on LINQ to Fail and was authored by Posts on LINQ to Fail


Print Share Comment Cite Upload Translate Updates
APA

Posts on LINQ to Fail | Sciencx (2014-02-12T00:00:00+00:00) Easily replacing Assert.IsTrue statements. Retrieved from https://www.scien.cx/2014/02/12/easily-replacing-assert-istrue-statements/

MLA
" » Easily replacing Assert.IsTrue statements." Posts on LINQ to Fail | Sciencx - Wednesday February 12, 2014, https://www.scien.cx/2014/02/12/easily-replacing-assert-istrue-statements/
HARVARD
Posts on LINQ to Fail | Sciencx Wednesday February 12, 2014 » Easily replacing Assert.IsTrue statements., viewed ,<https://www.scien.cx/2014/02/12/easily-replacing-assert-istrue-statements/>
VANCOUVER
Posts on LINQ to Fail | Sciencx - » Easily replacing Assert.IsTrue statements. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2014/02/12/easily-replacing-assert-istrue-statements/
CHICAGO
" » Easily replacing Assert.IsTrue statements." Posts on LINQ to Fail | Sciencx - Accessed . https://www.scien.cx/2014/02/12/easily-replacing-assert-istrue-statements/
IEEE
" » Easily replacing Assert.IsTrue statements." Posts on LINQ to Fail | Sciencx [Online]. Available: https://www.scien.cx/2014/02/12/easily-replacing-assert-istrue-statements/. [Accessed: ]
rf:citation
» Easily replacing Assert.IsTrue statements | Posts on LINQ to Fail | Sciencx | https://www.scien.cx/2014/02/12/easily-replacing-assert-istrue-statements/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.