Mocking HttpContext.server.MapPath in ASP.NET unit testing

前端 未结 3 1032
抹茶落季
抹茶落季 2021-02-04 21:29

I have working in unit testing in ASP.Net web application, now I have accessing my constructor in the model file to test which has Server.MapPath code for uploading my XMLfile,

3条回答
  •  情话喂你
    2021-02-04 22:24

    If you can't modify the source code, try using shims (https://msdn.microsoft.com/en-us/library/hh549176.aspx).

提交回复
热议问题