I am trying to execute a unit test page in my ASP.NET MVC application, which when submitted will remove the user element. I want to limit this page so that it can only be submitted by the owner of the specified item. Initially, I just wanted to stick to a quick check in the controller, which checked if the name HttpContext.Current.User.Identity.Name owned the element, but I quickly realized that unit testing would be difficult.
Should I create an interface that provides a way to access the current username registered on the network?
source
share