public void ConnectSectionViewModel_Ctor_IsVisibleAndExpanded()
        {
            var vm = new ConnectSectionViewModel();

            vm.IsVisible.Should().BeTrue();
            vm.IsExpanded.Should().BeTrue();
        }
Esempio n. 2
0
        public void ConnectSectionViewModel_Ctor_IsVisibleAndExpanded()
        {
            var vm = new ConnectSectionViewModel();

            Assert.IsTrue(vm.IsVisible);
            Assert.IsTrue(vm.IsExpanded);
        }
Esempio n. 3
0
        private void AssertCommandsInSync(SectionController section)
        {
            ConnectSectionViewModel viewModel = (ConnectSectionViewModel)section.ViewModel;

            viewModel.ConnectCommand.Should().Be(section.ConnectCommand, "ConnectCommand is not initialized");
            viewModel.BindCommand.Should().Be(section.BindCommand, "BindCommand is not initialized");
            viewModel.BrowseToUrlCommand.Should().Be(section.BrowseToUrlCommand, "BrowseToUrlCommand is not initialized");
        }
        private static ServerViewModel VerifyConnectSectionViewModelIsConnected(ConnectSectionViewModel 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);
        }
 private static void VerifyConnectSectionViewModelHasNoBoundProjects(ConnectSectionViewModel vm)
 {
     vm.State.HasBoundProject.Should().BeFalse("View model should not have any bound projects");
 }
        private static ServerViewModel VerifyConnectSectionViewModelIsConnectedAndHasNoProjects(ConnectSectionViewModel vm, ConnectionInformation connection)
        {
            ServerViewModel serverVM = VerifyConnectSectionViewModelIsConnected(vm, connection);

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

            return(serverVM);
        }
        private static ServerViewModel VerifyConnectSectionViewModelIsConnectedAndHasProjects(ConnectSectionViewModel 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);
        }
Esempio n. 8
0
 private static void VerifyConnectSectionViewModelHasNoBoundProjects(ConnectSectionViewModel vm)
 {
     Assert.IsFalse(vm.State.HasBoundProject, "View model should not have any bound projects");
 }
Esempio n. 9
0
        private static void VerifyConnectSectionViewModelIsNotConnected(ConnectSectionViewModel vm, ConnectionInformation connection)
        {
            ServerViewModel serverVM = vm.State?.ConnectedServers?.SingleOrDefault(s => s.Url == connection.ServerUri);

            Assert.IsNull(serverVM, "Should not find server view model for {0}", connection.ServerUri);
        }
Esempio n. 10
0
        private static ServerViewModel VerifyConnectSectionViewModelIsConnectedAndHasNoProjects(ConnectSectionViewModel vm, ConnectionInformation connection)
        {
            ServerViewModel serverVM = VerifyConnectSectionViewModelIsConnected(vm, connection);

            Assert.AreEqual(0, serverVM.Projects.Count, "Unexpected number of projects");

            return(serverVM);
        }