public void Setup()
        {
            _mockContext = SetupMockDataContext();

            var claim = new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", _mockContext.Object.Users.Single(x => x.UserName == "adhach").Id.ToString());

            _adHachClaims = new ClaimsPrincipal(new ClaimsIdentity(new List <Claim> {
                claim
            }));

            claim        = new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", _mockContext.Object.Users.Single(x => x.UserName == "tnt01user").Id.ToString());
            _tnt01Claims = new ClaimsPrincipal(new ClaimsIdentity(new List <Claim> {
                claim
            }));

            claim             = new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", _mockContext.Object.Users.Single(x => x.UserName == "tnt01and02user").Id.ToString());
            _tnt01And02Claims = new ClaimsPrincipal(new ClaimsIdentity(new List <Claim> {
                claim
            }));

            Thread.CurrentPrincipal = _tnt01Claims;

            var validator = new DashboardOptionValidator();

            _facade = new DashboardOptionFacade(_mockContext.Object, validator);

            _toCreateHachFusion = new DashboardOption()
            {
                Id       = Guid.Parse("7DDD52F4-A21D-4B99-A87F-A837DA940D40"),
                TenantId = _mockContext.Object.Tenants.Single(x => x.Name == "Hach Fusion").Id,
                Options  = "HachFusion_Options"
            };
        }
        public void Setup()
        {
            var claim = new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", _userId.ToString());

            Thread.CurrentPrincipal = new ClaimsPrincipal(new ClaimsIdentity(new List <Claim> {
                claim
            }));

            var connectionString = ConfigurationManager.ConnectionStrings["DataContext"].ConnectionString;

            _context = new DataContext(connectionString);

            _facade = new DashboardOptionFacade(_context, new DashboardOptionValidator());

            ODataHelper oDataHelper = new ODataHelper();

            _controller         = new DashboardOptionsController(oDataHelper, _facade);
            _controller.Request = new HttpRequestMessage();
            _controller.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());

            // Setting the URI of the request here is needed for the API POST method to work
            _controller.Request.RequestUri = new Uri("http://tempuri.com");

            /*
             * TODO: akrone - Taking on some Techincal Debt doing this, but pulling the Seeder into it's own project would need to
             *      be merged into other development work going on for sprint 60
             */
            Seeder.SeedWithTestData(_context);
        }
 public void TearDown()
 {
     _facade = null;
     _controller.Dispose();
     _context.Dispose();
 }