3
我有我嘗試進行單元測試的WCF服務。該服務唯一的依賴項是調用OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name知道使用該服務的Windows用戶(Windows身份驗證)我只想嘲笑這一點。 有人有簡單的方法來做到這一點?模擬WCF服務中的OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name
哇真的很感謝你!非常好的答案,因爲在我的服務中我有證書,我可以在我的單元測試中嘲笑當前的校長! –