随笔分类 -  Unit Test and Integration Test

MS Test Framework、NUnit、MOQ、Integration Test
摘要:I believe the biggest distinction is that a stub you have already written with predetermined behavior. So you would have a class that implements the dependency (abstract class or interface most likely) you are faking for testing purposes and the methods would just be stubbed out with set responses. 阅读全文
posted @ 2013-07-03 21:48 DebugLZQ 阅读(781) 评论(2) 推荐(0)
摘要:这篇博文分享下保龄球计分算法。计分规则描述如下:A game of tenpins bowling lasts ten frames, in each of which the bowler makes one or two attempts to knock down ten pins arran... 阅读全文
posted @ 2013-07-01 20:24 DebugLZQ 阅读(3413) 评论(1) 推荐(0)
摘要:I haven't seen much information online comparing the similarities and differences between the Nunit and MSTest Frameworks. Here I will define the similarities and some of the differences. MSTest AttributeNUnit AttributePurpose[TestMethod][Test]Indentifies of an individual unit test[TestClass][Te 阅读全文
posted @ 2013-06-29 01:41 DebugLZQ 阅读(827) 评论(1) 推荐(0)
摘要:MS Test也可以方便的进行单元测试,可以通过Visual Studio很方便的建立单元测试。添加对待测试工程的引用,即可方便的开始单元测试。最基本的一些测试使用如下:using System;using Microsoft.VisualStudio.TestTools.UnitTesting;namespace UnitTestProject1{ [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { } ... 阅读全文
posted @ 2013-06-26 09:38 DebugLZQ 阅读(3810) 评论(0) 推荐(0)
摘要:前面DebugLZQ写了一篇博文,介绍的是如何使用Nunit编写.NET单元测试。但是使用NUnti进行单元测试有一个致命的弱点:无法调试。因为我们的测试本省也是代码,同样我们不能确定我们的代码是对的。这篇博文将以在VS2010下连接数据库并插入一个字段的方法编写单元测试为例,介绍如何使用Tes... 阅读全文
posted @ 2012-07-09 16:32 DebugLZQ 阅读(3227) 评论(11) 推荐(2)
摘要:写这篇博文的目的是给大家分享,如何使用NUnit为我们的.NET应用程序编写单元测试,文章假设读者没有使用过NUnit的新手,如果你是老手,可以跳过本文。如果你对NUnit还不是很了解的话,我建议你还是阅读一下。首先介绍几个概念。1.NUnit的介绍 NUnit是一个单元测试框架,专门针对于.NET来写的。其实在前面有JUnit(Java),CPPUnit(C++),他们都是xUnit的一员。最初,它是从JUnit而来.现在的版本是2.6.接下来我所用的都是基于这个版本。 NUnit最初是由James W. Newkirk,Alexei A. Vorontsov 和Philip A. ... 阅读全文
posted @ 2012-07-08 15:27 DebugLZQ 阅读(1736) 评论(1) 推荐(1)