我如何在C#中进行单元测试

我如何在C#中进行单元测试

本文介绍了我如何在C#中进行单元测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好, 我如何进行单元测试,如果我有这个: 我写的关于此的代码:有客户,需要查找具有相同名称,地址或电话的客户(可以是2个或更多),然后需要从中选择2个客户,并将它们合并(第二个客户将从db,但是他们的属性将附加到客户,已经合并。) 现在我要检查,如果其他客户从数据库中删除,他们的属性(帐户,姓氏)是否附加到合并的客户或没有? public int MergeCustomer(客户客户, int deletedCustomerID){} _db.SaveChanges(); scope.Complete(); 感谢您的帮助。解决方案 Hello,How do i unit testing, if i have this:I wrote code about this: Have "customer", need find customers, that have same name, address, or phone(they can be 2 and more) , then need choose from them 2 customers, and merge them both(second customers will be deleted from db, but them property will attach to customer, that already was merged.)Now i want check , if others customers deleted from db, them property(account,surname, and etc.) was attach to merged customer or no?public int MergeCustomer(Customer customer, int deletedCustomerID){}_db.SaveChanges(); scope.Complete();Thank you for help. 解决方案 这篇关于我如何在C#中进行单元测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-30 19:08