摘要:
有的时候我们需要对Razor最后生产的文本(HTML OR XML OR..)进行单元测试。使用Nuget安装RazorEngine。新建一个ASP.NET MVC项目,并且带有测试项目。修改Index.cshtml@using TestRazor.Models@model TestModelThi... 阅读全文
摘要:
If you want to unit test a private method, something may be wrong. Unit tests are (generally speaking) meant to test the interface of a class, meaning... 阅读全文
摘要:
Q1:首先定义一个结构public struct MyStruct { public int T; }定义一个泛型List来存放结构体,然后访问第一个元素去修改T,输出T:List arrLis =new List(){new MyStruct()}; arrLis[0].T = 100;Console.WriteLine(arrLis[0].T);大家猜是什么结果?很遗憾不是100,arrLis[0].T = 100;VS提示该语句有错误。Cannot modify the expression because it is not a variable.说修改的不是一个变量。这是为什么呢?关 阅读全文