我正在组织一个关于单元测试的好处的演示文稿,我想要一个意想不到的后果的简单示例:在一个类中更改代码以破坏另一个类中的功能.
有人可以建议一个简单,易于解释的例子吗?
我的计划是围绕此功能编写单元测试,以证明我们知道我们通过立即运行测试来破坏某些东西.
我有一个具有多个接收功能的WF4工作流程.
工作流运行正常,直到我添加持久性.我创建了持久性表,并将以下内容添加到web.config的\ configuration\system.serviceModel\behaviors\serviceBehaviors部分:
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true" />
<sqlWorkflowInstanceStore connectionStringName="InstanceStore"
instanceCompletionAction="DeleteAll"
instanceLockedExceptionAction= "NoRetry"
instanceEncodingOption="None"
hostLockRenewalPeriod="00:01:00"
/>
</behavior>
Run Code Online (Sandbox Code Playgroud)
工作流接受一个参数,该参数是我定义的WorkflowInstanceDTO POCO的实例.
当我使用以下代码运行工作流程时
var wfi = new WFService.WorkflowInstanceDTO()
{
Id = 1,
InstanceId …Run Code Online (Sandbox Code Playgroud)