You can write Unittest with both database data and Mock data. If you want to create a mock layer i recommend you implement the Repository Pattern and Dependency Injection.
The below example i have demonstrate a basic unit test with basic ASP.NET MVC Unitesting framework without using Dependency Injection
[TestClass]
public class YourControllerTest
{
private readonly SettingsController _settingsController = null;
public SettingsControllerTest()
{
_settingsController=new SettingsController();
}
[TestMethod]
public void ListeSessionFraisType_Of_IEnumerable_W_H59MpxSessionFrais()
{
var indexModel = _settingsController.ListeSessionFrais();
Assert.IsInstanceOfType(indexModel, typeof(IEnumerable<W_H59MpxSessionFrais>));
}
}
Don't pass datacontext as a parameter. Please follow the Repository pattern.It will also abstract the datacontext away from the code and can test the business logic(Repositories) alone. You will get a lot code examples from the net for Repository Pattern
Hope this helps