public void MyTestInitialize()
        {
            // Setup context
            var mySimplTestContext = new SIMPLTestContext();
            HttpContext.Current = mySimplTestContext.GetHttpSession();

            // verified that uitestuser has a valid email address in ASPP
            CurrentUser.SetInstance("uitestuser");

            RosettianUser = CurrentUser.AsUserDto();

            _mailersInformationEntitiesTestRepositoryForTests = new MailersInformationEntitiesTestRepository();

            EquipmentOrderControllerForTests = DependencyResolver.Current.GetService<EquipmentOrderController>();
            EquipmentOrderControllerForTests.ControllerContext = new ControllerContext(new HttpContextWrapper(HttpContext.Current), new RouteData(), EquipmentOrderControllerForTests);

            var key = "FiosEquipmentCatalogId";
            FiOSCatalogId = ConfigurationManager.AppSettings[key];
            if (FiOSCatalogId == null)
            {
                throw new Exception(string.Format("AppSettings key \"{0}\" is missing", key));
            }

            key = "UverseEquipmentCatalogId";
            UVerseCatalogId = ConfigurationManager.AppSettings[key];
            if (UVerseCatalogId == null)
            {
                throw new Exception(string.Format("AppSettings key \"{0}\" is missing", key));
            }

            key = "TivoEquipmentCatalogId";
            TiVoEquipmentCatalogId = ConfigurationManager.AppSettings[key];
            if (TiVoEquipmentCatalogId == null)
            {
                throw new Exception(string.Format("AppSettings key \"{0}\" is missing", key));
            }

            key = "TivoReturnMailerCatalogId";
            TiVoReturnMailerCatalogId = ConfigurationManager.AppSettings[key];
            if (TiVoReturnMailerCatalogId == null)
            {
                throw new Exception(string.Format("AppSettings key \"{0}\" is missing", key));
            }

            key = "TivoRemoteCatalogId";
            TiVoRemoteCatalogId = ConfigurationManager.AppSettings[key];
            if (TiVoReturnMailerCatalogId == null)
            {
                throw new Exception(string.Format("AppSettings key \"{0}\" is missing", key));
            }
        }
Ejemplo n.º 2
0
        public void MyTestInitialize()
        {
            // Helper code to get the HttpContext
            var mySIMPLTestContext = new SIMPLTestContext();
            HttpContext.Current = mySIMPLTestContext.GetHttpSession();

            // Helper Code to get the user logged into Windows
            var userName = mySIMPLTestContext.GetNameFromWindowsIdentity();

            // Calling actual production code to set the instance for this username
            CurrentUser.SetInstance(userName);

            // Calling actual production code to get the Rosettian User Object
            RosettianUser = CurrentUser.AsUserDto();

            BusinessFacadeforTests = DependencyResolver.Current.GetService<IBusinessFacade>();
            SubscriberHelperforTests = DependencyResolver.Current.GetService<SubscriberHelper>();

            // Set up the LocationController
            LocationController4Tests = DependencyResolver.Current.GetService<LocationController>();

            LocationController4Tests.ControllerContext = new ControllerContext(new HttpContextWrapper(HttpContext.Current), new RouteData(), LocationController4Tests);
        }
Ejemplo n.º 3
0
        public void MyTestInitialize()
        {
            // Setup context
            var mySimplTestContext = new SIMPLTestContext();
            HttpContext.Current = mySimplTestContext.GetHttpSession();

            var userName = mySimplTestContext.GetNameFromWindowsIdentity();
            CurrentUser.SetInstance(userName);
            RosettianUser = CurrentUser.AsUserDto();

            // Setup ResidentialGatewayController
            BusinessFacadeforTests = DependencyResolver.Current.GetService<IBusinessFacade>();
            EquipmentControllor4Test = DependencyResolver.Current.GetService<EquipmentController>();
            EquipmentControllor4Test.ControllerContext = new ControllerContext(new HttpContextWrapper(HttpContext.Current),
                new RouteData(), EquipmentControllor4Test);
        }
Ejemplo n.º 4
0
        public void MyTestInitialize()
        {
            // Setup context
            var mySimplTestContext = new SIMPLTestContext();
            HttpContext.Current = mySimplTestContext.GetHttpSession();

            var userName = mySimplTestContext.GetNameFromWindowsIdentity();
            CurrentUser.SetInstance(userName);
            RosettianUser = CurrentUser.AsUserDto();

            // Instantiate FacilitiesController used for tests implemented in this class

            BusinessFacadeforTests = DependencyResolver.Current.GetService<IBusinessFacade>();
            FacilitiesController4Test = DependencyResolver.Current.GetService<FacilitiesController>();
            FacilitiesController4Test.ControllerContext = new ControllerContext
            (
                new HttpContextWrapper(HttpContext.Current),
                new RouteData(),
                FacilitiesController4Test
            );
        }
Ejemplo n.º 5
0
        public void MyTestInitialize()
        {
            // Setup context
            var mySimplTestContext = new SIMPLTestContext();
            HttpContext.Current = mySimplTestContext.GetHttpSession();

            var userName = mySimplTestContext.GetNameFromWindowsIdentity();
            CurrentUser.SetInstance(userName);

            CheckinController = DependencyResolver.Current.GetService<CheckinController>();
            CheckinController.ControllerContext = new ControllerContext(new HttpContextWrapper(HttpContext.Current), new RouteData(), CheckinController);
        }