public void TestAssociationWithSolution()
        {
            var model = new ExtensionDataModel(this.service, this.vshelper, null);
            var projectAsso = new Resource { Key = "KEY" };

            model.AssociateProjectToSolution();
            Assert.AreEqual("Selected Project: KEY", model.AssociatedProjectKey);
            model.AssociateProjectToSolution();
            Assert.AreEqual("Selected Project: KEY", model.AssociatedProjectKey);
        }
        public void TestAssociationWithSolution()
        {
            this.mocks = new MockRepository();
            this.service = this.mocks.Stub<ISonarRestService>();
            this.vshelper = this.mocks.Stub<IVsEnvironmentHelper>();
            var resource = new Resource { Key = "KEY" };
            var resources = new List<Resource> { resource };

            using (this.mocks.Record())
            {
                SetupResult.For(this.service.GetServerInfo(Arg<ISonarConfiguration>.Is.Anything)).Return(3.6);
                SetupResult.For(this.service.AuthenticateUser(Arg<ISonarConfiguration>.Is.Anything)).Return(true);
                SetupResult.For(this.service.GetResourcesData(Arg<ISonarConfiguration>.Is.Anything, Arg<string>.Is.Equal("KEY"))).Return(resources);
                SetupResult.For(this.vshelper.ReadSavedOption("Sonar Options", "General", "SonarHost")).Return("serveraddr");
                SetupResult.For(this.vshelper.ReadSavedOption("Sonar Options", "General", "SonarUserPassword")).Return("password");
                SetupResult.For(this.vshelper.ReadSavedOption("Sonar Options", "General", "SonarUserName")).Return("login");
                SetupResult.For(this.vshelper.ActiveSolutionName()).Return("Solution");
                SetupResult.For(this.vshelper.ReadOptionFromApplicationData("Solution", "PROJECTKEY")).Return("KEY");
            }

            var model = new ExtensionDataModel(this.service, this.vshelper, null, null);

            model.AssociateProjectToSolution();
            Assert.AreEqual("Selected Project: KEY", model.AssociatedProjectKey);
            model.AssociateProjectToSolution();
            Assert.AreEqual("Selected Project: KEY", model.AssociatedProjectKey);
        }