2012年2月12日

Before You Refactor 重构之前

摘要: Rajith Attapattu AT SOME POiNT, every programmer will need to refactor existing code. But before you do so, please think about the following, as this could save you and others a great deal of time (and pain):在有些时候,每个程序员都需要重构现有的代码。但在你做之前,请想一下下面的事项,这能节省你和其他人的很多时间(和痛苦)。The best approach for restructuri 阅读全文

posted @ 2012-02-12 00:26 蚂蚁蚂蚁 阅读(161) 评论(0) 推荐(0) 编辑

Beauty Is in Simplicity 美在于简单

摘要: Jørn ØlmheimTHERE iS ONE qUOTE, from Plato, that I think is particularly good for all software developers to know and keep close to their hearts:Beauty of style and harmony and grace and good rhythm depends on simplicity.引用柏拉图的一句话,我认为尤其对软件开发人员有用且要铭记于心的。美丽的风格与和谐,优雅和良好的节奏取决于简单。
In one senten 阅读全文

posted @ 2012-02-12 00:24 蚂蚁蚂蚁 阅读(353) 评论(0) 推荐(0) 编辑

Automate Your Coding Standard 自动化你的编码标准

摘要: Automate Your Coding Standard 自动化你的编码标准Filip van LaenenYOU’VE PROBABLY BEEN THERE, TOO. At the beginning of a project, every- body has lots of good intentions—call them “new project’s resolutions.” Quite often, many of these resolutions are written down in documents. The ones about code end up in th 阅读全文

posted @ 2012-02-12 00:23 蚂蚁蚂蚁 阅读(213) 评论(1) 推荐(1) 编辑

Act with Prudence 三思而后行

摘要: Seb RoseWhatever you undertake, act with prudence and consider the consequences.—Anon无论做什么事情,都要三思而后行。-AnonNO MATTER HOW COMFORTABLE A SCHEDULE LOOKS at the beginning of an iteration, you can’t avoid being under pressure some of the time. If you find yourself having to choose between “doing it right” 阅读全文

posted @ 2012-02-12 00:21 蚂蚁蚂蚁 阅读(216) 评论(0) 推荐(1) 编辑

Technical Debt Quadrant 技术债象限

摘要: 14 October 2009 Martin FowlerThere's been a few posts over the last couple of months about TechnicalDebt that's raised the question of what kinds of design flaws should or shouldn't be classified as Technical Debt.前几个月的一些关于技术债的帖子引出了这样一个问题,什么样的设计缺陷应该或者不应该归为技术债。A good example of this is Un 阅读全文

posted @ 2012-02-12 00:19 蚂蚁蚂蚁 阅读(735) 评论(1) 推荐(0) 编辑

2011年11月27日

xUnit Extension之DataTheories

摘要: 通过为测试添加[Theory]属性,我们可以进行数据驱动的测试。测试数据分为以下几种: 1. InlineData, 由InlineDataAttribute提供 //Provides a data source for a data theory, with the data coming from inline values.[Theory][InlineData("a",... 阅读全文

posted @ 2011-11-27 00:49 蚂蚁蚂蚁 阅读(403) 评论(0) 推荐(0) 编辑

2011年11月26日

xUnit 之 Equal(1)

摘要: Equal恐怕是写xUnit测试使用最多的方法。那么Equal方法到底能进行哪些类型参数的比较呢? 我们首先看一下Equal方法的几种重载形式: 1. 最常用到的一种形式: /// <summary>/// Verifies that two objects are equal, using a default comparer./// </summary>/// <typeparam name="T">The type of the objects to be compared</typeparam>/// <para 阅读全文

posted @ 2011-11-26 14:31 蚂蚁蚂蚁 阅读(536) 评论(0) 推荐(1) 编辑

xUnit Assert之其他

摘要: 1. Contains test [Fact]public void CanFindNullInContainer(){ var list = new List<object> { 16, null, "Hi there" }; Assert.Contains(null, list);} [Fact]public void ListInContainer(){ var list = new List<object> {1, 2, 3}; var list2 = new List<object> {4, 5, list}; Assert.C 阅读全文

posted @ 2011-11-26 14:13 蚂蚁蚂蚁 阅读(824) 评论(0) 推荐(0) 编辑

xUnit之Equal(2)

摘要: 继续上节,列举一下Equal测试的类型: 1. ArrayTest [Fact]public void Array(){ string[] expected = { "@", "a", "ab", "b" }; string[] actual = { "@", "a", "ab", "b" }; Assert.Equal(expected, actual); Assert.Throws<NotEqualException>( 阅读全文

posted @ 2011-11-26 13:36 蚂蚁蚂蚁 阅读(304) 评论(0) 推荐(0) 编辑

2011年11月24日

What is xUnit.net? Xunit 是什么 ?

摘要: xUnit.net is a unit testing tool for the .NET Framework.Written by the original inventor of NUnit, xUnit.net is the latest technology for unit testing C#, F#, VB.NET and other .NET languages. Works with ReSharper, CodeRush, and TestDriven.NET.xUnit.net 是一个用于.NET框架的单元测试工具。xUnit出自Nunit创始人之手。可用于C#,... 阅读全文

posted @ 2011-11-24 00:36 蚂蚁蚂蚁 阅读(625) 评论(0) 推荐(0) 编辑

导航