Example #1
0
        private static AgencyController GetAgencyController(RouteData routedata)
        {
            var controller = new AgencyController();

            HttpContextStub.SetupController(controller, routedata);
            return(controller);
        }
Example #2
0
 public void GotoLogin()
 {
     using (var controller = new AgencyController())
     {
         _result = controller.Login();
     }
 }
Example #3
0
        public AgencyControllerTest()
        {
            var logger = new Mock <ILogger <Agency> >();

            _service    = new Mock <IAgencyService>();
            _controller = new AgencyController(logger.Object, _service.Object);
        }
Example #4
0
 public void NavigateToHome()
 {
     using (var controller = new AgencyController())
     {
         _result = controller.Login();
     }
 }
Example #5
0
        public void Login(string email, string password)
        {
            using (var controller = new AgencyController())
            {
                var mContext = new Mock <ControllerContext>();
                var mSession = new Mock <HttpSessionStateBase>();
                mContext.SetupGet(c => c.HttpContext.Session).Returns(mSession.Object);
                controller.ControllerContext = mContext.Object;

                _result = controller.Login(email, password);
                //loginResult = controller.Login("*****@*****.**", "123456");
                //ScenarioContext.Current.Add(loginResult, _result);
            }
        }
        public AgencyControllerTest()
        {
            iConfigurationMock              = new Mock <IConfiguration>();
            loggerMock                      = new Mock <ILogger>();
            _iAgency                        = new Mock <IConnection <Core.Model.Agency.Agency> >();
            _iAgencyContactMock             = new Mock <IConnection <AgencyContacts> >();
            _iAgencyIncludedCountryMock     = new Mock <IConnection <IncludedCountryRelation> >();
            _iAgencyExcludedCountryMock     = new Mock <IConnection <ExcludedCountryRelation> >();
            _iAgencySupplierRelationMock    = new Mock <IConnection <AgencySupplierRelation> >();
            _iAgencyBankMock                = new Mock <IConnection <Bank> >();
            _iAgencyPaymentMock             = new Mock <IConnection <Payment> >();
            _iAgencySuperUserMock           = new Mock <IConnection <Agents> >();
            _iAgencyBranchMock              = new Mock <IConnection <Core.Model.Agency.Branch> >();
            _iAgencyBranchAgentRelationMock = new Mock <IConnection <BranchAgentRelation> >();
            _iMasterData                    = new Mock <IMasterData <Models.Request.Agency, int> >();
            _iAgencyRepositoryMock          = new Mock <IAgency>();

            agencyController = new AgencyController(_iMasterData.Object, loggerMock.Object, _iAgency.Object, iConfigurationMock.Object,
                                                    _iAgencyContactMock.Object, _iAgencyIncludedCountryMock.Object, _iAgencyExcludedCountryMock.Object, _iAgencyPaymentMock.Object,
                                                    _iAgencyBankMock.Object, _iAgencySupplierRelationMock.Object, _iAgencySuperUserMock.Object, _iAgencyBranchMock.Object,
                                                    _iAgencyBranchAgentRelationMock.Object, _iAgencyRepositoryMock.Object);
        }