public void ViewComponentLoadsPrivateWithOwnerId()
        {
            var userName = "******";
            var ownerId  = "owner-1";
            var area     = "summary";

            var vc = new DashboardMenuViewComponent(_mockRepoSettingsStore.Object);

            // Set user
            vc.ViewComponentContext = GetViewContext(_mockHttpContext, userName);

            var asyncResult = vc.InvokeAsync(ownerId, "", area);

            Assert.NotNull(asyncResult.Result);

            var result = asyncResult.Result as ViewViewComponentResult;

            Assert.NotNull(result);
            var model = result.ViewData?.Model as DashboardMenuViewModel;

            Assert.NotNull(model);

            Assert.Equal(ownerId, model.SelectedOwnerId);
            Assert.Equal(area, model.ActiveArea);
            Assert.Equal("", model.SelectedRepoId);
            Assert.NotNull(model.UserViewModel);
            Assert.Equal(userName, model.UserViewModel.GitHubName);
            Assert.NotNull(model.Owners);
            Assert.Single(model.Owners);
            Assert.Equal("owner-1", model.GetDashContext());

            _mockRepoSettingsStore.Verify(m => m.GetRepoSettingsForOwnerAsync(ownerId), Times.Once);
        }
        public void ViewComponentLoadsPublicWithOwnerId()
        {
            var ownerId     = "owner-1";
            var area        = "summary";
            var vc          = new DashboardMenuViewComponent(_mockRepoSettingsStore.Object);
            var asyncResult = vc.InvokeAsync(ownerId, "", area);

            Assert.NotNull(asyncResult.Result);
            _mockRepoSettingsStore.Verify(m => m.GetRepoSettingsForOwnerAsync(ownerId), Times.Never);
            var result = asyncResult.Result as ViewViewComponentResult;

            Assert.NotNull(result);
            var model = result.ViewData?.Model as DashboardMenuViewModel;

            Assert.NotNull(model);

            Assert.Equal(ownerId, model.SelectedOwnerId);
            Assert.Equal(area, model.ActiveArea);
            Assert.Equal("", model.SelectedRepoId);
            Assert.Null(model.UserViewModel);
        }