private static ServerViewModel VerifyConnectSectionViewModelIsConnected(IConnectSectionViewModel vm, ConnectionInformation connection)
        {
            ServerViewModel serverVM = vm.State?.ConnectedServers?.SingleOrDefault(s => s.Url == connection.ServerUri);

            serverVM.Should().NotBeNull("Could not find server view model for {0}", connection.ServerUri);

            return(serverVM);
        }
 public ConnectSectionView(IConnectSectionViewModel connectSectionViewModel)
 {
     InitializeComponent();
     DataContext = connectSectionViewModel;
     connectSectionViewModel.Initialize();
 }
 private static void VerifyConnectSectionViewModelHasNoBoundProjects(IConnectSectionViewModel vm)
 {
     vm.State.HasBoundProject.Should().BeFalse("View model should not have any bound projects");
 }
        private static ServerViewModel VerifyConnectSectionViewModelIsConnectedAndHasNoProjects(IConnectSectionViewModel vm, ConnectionInformation connection)
        {
            ServerViewModel serverVM = VerifyConnectSectionViewModelIsConnected(vm, connection);

            serverVM.Projects.Should().BeEmpty("Unexpected number of projects");

            return(serverVM);
        }
        private static ServerViewModel VerifyConnectSectionViewModelIsConnectedAndHasProjects(IConnectSectionViewModel vm, ConnectionInformation connection, SonarQubeProject[] projects)
        {
            ServerViewModel serverVM = VerifyConnectSectionViewModelIsConnected(vm, connection);

            CollectionAssert.AreEquivalent(projects, serverVM.Projects.Select(p => p.Project).ToArray(), "Unexpected projects for server {0}", connection.ServerUri);

            return(serverVM);
        }