Exemple #1
0
        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);
        }
Exemple #2
0
 public EstimateControllerUnitTest()
 {
     unitOfWork = new FakeUnitOfWork();
     controller = new EstimatesController(unitOfWork);
 }
Exemple #3
0
 public PostalCodeEstimates()
 {
     _estimatesController = DependencyInjectionContainer.GetEstimatesController(this);
     InitializeComponent();
 }