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