コード例 #1
0
        public void SetUp()
        {
            // you have to be an administrator to access the CMS controller
            Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("admin"), new[] { "Administrator" });

            postageRepository  = MockRepository.GenerateStub <IRepository <Postage> >();
            orderableService   = MockRepository.GenerateStub <IOrderableService <Postage> >();
            httpContextService = MockRepository.GenerateStub <IHttpContextService>();

            postageController = new PostageController
            {
                Repository         = postageRepository,
                OrderableService   = orderableService,
                HttpContextService = httpContextService
            };
        }
コード例 #2
0
        public void SetUp()
        {
            // you have to be an administrator to access the CMS controller
            Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("admin"), new[] { "Administrator" });

            postageRepository = MockRepository.GenerateStub<IRepository<Postage>>();
            orderableService = MockRepository.GenerateStub<IOrderableService<Postage>>();
            httpContextService = MockRepository.GenerateStub<IHttpContextService>();

            postageController = new PostageController
            {
                Repository = postageRepository,
                OrderableService = orderableService,
                HttpContextService = httpContextService
            };
        }