摘要:
1)First case for an sample user:publicclassMockHttpContext:HttpContextBase{privatereadonlyIPrincipal_user=newGenericPrincipal(newGenericIdentity("username"),null/*roles*/);publicoverrideIPrincipalUser{get{return_user;}set{base.User=value;}}publicMockHttpContext(stringUserName){_user=newGen 阅读全文