unit test
1) State vs Behaviour Verification
https://manas.tech/blog/2009/04/30/state-vs-behaviour-verification.html
2) Unit testing a class with no return value?
http://stackoverflow.com/questions/1607339/unit-testing-a-class-with-no-return-value
we should test it only when it's functionality is vital, then we can use mock objects in the test, see 1)
3) Should I test private methods or only public ones?
http://stackoverflow.com/questions/105007/should-i-test-private-methods-or-only-public-ones
a complete test for public function is enough.
private/protected methods are not parts of the API, they are basically implementation choices (we can change to some other implementation),
that you can decide to review, update or throw away completely without any impact on the outside.
and testing private methods separately won't make the overall test complete no matter how hard you try.
(Private functions mainly exists in our class because we want to create readable code in our public methods)
unit test的更多相关文章
- ABP(现代ASP.NET样板开发框架)系列之12、ABP领域层——工作单元(Unit Of work)
点这里进入ABP系列文章总目录 基于DDD的现代ASP.NET开发框架--ABP系列之12.ABP领域层——工作单元(Unit Of work) ABP是“ASP.NET Boilerplate Pr ...
- ABP源码分析十:Unit Of Work
ABP以AOP的方式实现UnitOfWork功能.通过UnitOfWorkRegistrar将UnitOfWorkInterceptor在某个类被注册到IOCContainner的时候,一并添加到该类 ...
- Failed to stop iptables.service: Unit iptables.service not loaded.
redhat 7 [root@lk0 ~]# service iptables stop Redirecting to /bin/systemctl stop iptables.service Fai ...
- VS2012 Unit Test 个人学习汇总(含目录)
首先,给出MSDN相关地址:http://msdn.microsoft.com/en-us/library/Microsoft.VisualStudio.TestTools.UnitTesting.a ...
- VS2012 Unit Test —— 我对IdleTest库动的大手术以及对Xml相关操作进行测试的方式
[1]我的IdleTest源码地址:http://idletest.codeplex.com/ [2]IdleTest改动说明:2013年10月份在保持原有功能的情况下对其动了较大的手术,首先将基本的 ...
- VS2012 Unit Test——Microsoft Fakes入门
如题,本文主要作为在VS2012使用Fakes的入门示例,开发工具必须是VS2012或更高版本. 关于Fakes的MSDN地址:http://msdn.microsoft.com/en-us/libr ...
- MTU(Maximum transmission unit) 最大传输单元
最大传输单元(Maximum transmission unit),以太网MTU为1500. 不同网络MTU如下: 如果最大报文数据大小(MSS)超过MTU,则会引起分片操作. 路径MTU: 网路 ...
- Simulink Memory vs Unit Delay
Memoryブロック.Unit Delayブロック共に前回の入力値を出力しますが.動作するタイミングが異なります. ●Memoryブロック シミュレーションの各時刻(ステップ)で動作し.「1ステップ」 ...
- GRU(Gated Recurrent Unit) 更新过程推导及简单代码实现
GRU(Gated Recurrent Unit) 更新过程推导及简单代码实现 RNN GRU matlab codes RNN网络考虑到了具有时间数列的样本数据,但是RNN仍存在着一些问题,比如随着 ...
- Unit Testing with NSubstitute
These are the contents of my training session about unit testing, and also have some introductions a ...
随机推荐
- 使用Calender类获取系统时间和时间和运算
使用Calender类获取系统时间和时间和运算: @Test public void testCal(){ //使用Calender对象获取时间,并对时间进行计算: Calendar instance ...
- linux连接工具隧道模式
使用linux连接工具,比如putty,xshell可以使用隧道模式跳转登录其他服务器 A->B B->C 比如正常情况下,A主机能访问B主机,B主机能访问C主机,那么就可以设置隧道模式让 ...
- 使用 CROSS APPLY 与 OUTER APPLY 连接查询
Ø 前言 日常开发中遇到多表查询时,首先会想到 INNER JOIN 或 LEFT OUTER JOIN 等等,但是这两种查询有时候不能满足需求.比如,左表一条关联右表多条记录时,我需要控制右表的某 ...
- 微信小程序开发(2) 计算器
在这篇微信小程序开发教程中,我们将介绍如何使用微信小程序开发计算器功能. 本文主要分为两个部分,小程序主体部分及计算器业务页面部分 一.小程序主体部分 一个小程序主体部分由三个文件组成,必须放在项目的 ...
- tcp_listen函数
#include <netdb.h> #include <unistd.h> #include <stddef.h> #include <strings.h& ...
- TensorFlow从入门到理解
一.<莫烦Python>学习笔记: TensorFlow从入门到理解(一):搭建开发环境[基于Ubuntu18.04] TensorFlow从入门到理解(二):你的第一个神经网络 Tens ...
- lua 的元表与元方法
1. 元表与元方法, 相当于C++的函数重载 参考链接: https://blog.csdn.net/yueya_shanhua/article/details/52233228
- 20165237 2017-2018-2 《Java程序设计》第1周学习总结
20165237 2017-2018-2 <Java程序设计>第1周学习总结 教材学习内容总结 1.平台=OS(操作系统)+CPU 2.Java具有简单.面向对象.平台无关和动态性. 3. ...
- 20165234 《Java程序设计》第九周学习总结
第九周学习总结 教材内容学习 第十三章 Java 网络编程 URL 类 URL 类是 java.net 包中的一个重要的类,使用URL创建对象的应用程序称为客户端程序. 一个 URL 对象通常包含最基 ...
- Linux C++ UDP Socket通信实例
环境:Linux 语言:C++ 通信方式:UDP 服务器端的步骤如下: 1. socket: 建立一个socket 2. bind: 将这个socket绑定在某个端口上(A ...