public void TestInitialize()
        {
            this.logger                  = new Mock <ILogger <ResourceController> >();
            this.telemetryClient         = new TelemetryClient(new TelemetryConfiguration());
            this.unitOfWork              = new Mock <IUnitOfWork>();
            this.resourceMapper          = new Mock <IResourceMapper>();
            this.usersServiceMock        = new Mock <IUsersService>();
            this.memberValidationService = new Mock <IMemberValidationService>();
            this.accessTokenHelper       = new FakeAccessTokenHelper();
            this.securityGroupOptions    = Options.Create(new SecurityGroupSettings());

            this.resourceController = new ResourceController(
                this.unitOfWork.Object,
                this.telemetryClient,
                this.logger.Object,
                this.usersServiceMock.Object,
                this.resourceMapper.Object,
                this.memberValidationService.Object,
                this.securityGroupOptions)
            {
                ControllerContext = new ControllerContext(),
            };

            this.resourceController.ControllerContext.HttpContext =
                FakeHttpContext.GetDefaultContextWithUserIdentity();
        }
Exemplo n.º 2
0
        public void TestInitialize()
        {
            this.logger = new Mock <ILogger <MemberValidationController> >();
            this.securityGroupOptions    = Options.Create <SecurityGroupSettings>(new SecurityGroupSettings());
            this.memberValidationService = new Mock <IMemberValidationService>();
            this.telemetryClient         = new TelemetryClient(new TelemetryConfiguration());

            this.controller = new MemberValidationController(
                this.telemetryClient,
                this.logger.Object,
                this.memberValidationService.Object,
                this.securityGroupOptions);

            this.controller.ControllerContext = new ControllerContext
            {
                HttpContext = FakeHttpContext.GetDefaultContextWithUserIdentity(),
            };
        }
        public void TestInitialize()
        {
            this.logger           = new Mock <ILogger <TagController> >();
            this.telemetryClient  = new TelemetryClient(new TelemetryConfiguration());
            this.unitOfWork       = new Mock <IUnitOfWork>();
            this.tagMapper        = new Mock <ITagMapper>();
            this.usersServiceMock = new Mock <IUsersService>();

            this.tagController = new TagController(
                this.logger.Object,
                this.telemetryClient,
                this.unitOfWork.Object,
                this.tagMapper.Object,
                this.usersServiceMock.Object)
            {
                ControllerContext = new ControllerContext(),
            };
            this.tagController.ControllerContext.HttpContext =
                FakeHttpContext.GetDefaultContextWithUserIdentity();
        }