private EstimatesController createContext(EstimatesController con) { con.ControllerContext = new ControllerContext(); //Creates a new HttpContext con.ControllerContext.HttpContext = new DefaultHttpContext(); con.ObjectValidator = new DefaultObjectValidator ( new DefaultModelMetadataProvider ( new DefaultCompositeMetadataDetailsProvider(Enumerable.Empty <IMetadataDetailsProvider>()) ), new List <Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IModelValidatorProvider>() ); //Returns the controller return(con); }
public EstimateControllerUnitTest() { unitOfWork = new FakeUnitOfWork(); controller = new EstimatesController(unitOfWork); }
public PostalCodeEstimates() { _estimatesController = DependencyInjectionContainer.GetEstimatesController(this); InitializeComponent(); }