public void OnAfterCreated(DTE DTEObject) { m_settings = new AddInSettings(DTEObject); lstResyncIgnoreList.Items.Clear(); if (m_settings.ResyncIgnoreList.Length > 0) { string[] list = m_settings.ResyncIgnoreList.Split(new char[] { ';' }); foreach (string item in list) { if (item.Length > 0) lstResyncIgnoreList.Items.Add(item); } } txtResyncIgnoreList.Text = string.Empty; btnAddResyncIgnoreItem.Enabled = false; btnDeleteResyncIgnoreItem.Enabled = false; cbIgnoreHiddenFiles.Checked = m_settings.ResyncIgnoreHiddenFiles; lstSyncFolders.Items.Clear(); if (m_settings.SyncFolderList.Length > 0) { string[] list = m_settings.SyncFolderList.Split(new char[] { ';' }); foreach (string item in list) { if (item.Length > 0) lstSyncFolders.Items.Add(item); } } txtSyncFolder.Text = string.Empty; btnAddSyncFolderItem.Enabled = false; btnDeleteSyncFolderItem.Enabled = false; }
public WelcomeWizard(AddInSettings settings) { InitializeComponent(); m_settings = settings; wizard1.CancelEnabled = false; envGroupMaven2 = lstEnvironment.Groups.Add("Maven 2", "Maven 2"); envGroupJava = lstEnvironment.Groups.Add("Java 5", "Java 5"); envGroupUmlTools = lstEnvironment.Groups.Add("UML Tools", "UML Tools"); //envGroupMaven1 = lstEnvironment.Groups.Add("Maven 1 (optional)", "Maven 1 (optional)"); itemMaven2Install = new Maven2InstallCheck(envGroupMaven2); itemMaven2SettingsXml = new Maven2SettingsCheck(envGroupMaven2, m_settings); itemJavaHome = new JavaHomeCheck(envGroupJava); itemJRE = new JRECheck(envGroupJava); itemMagicDraw = new UmlModelerCheck(envGroupUmlTools, m_settings); //itemMaven1Install = new Maven1InstallCheck(envGroupMaven1); //itemMavenHomeCheck = new MavenHomeCheck(envGroupMaven1); //itemMaven1BuildProperties = new Maven1SettingsCheck(envGroupMaven1, m_settings); lstEnvironment.Items.AddRange(new ListViewItem[] { itemMaven2Install, itemMaven2SettingsXml, itemJavaHome, itemJRE, itemMagicDraw //itemMavenHomeCheck, //itemMaven1Install, //itemMaven1BuildProperties, }); }
public void GetDynamicMenu_ReturnsSettingsButton() { var settings = new AddInSettings(string.Empty, string.Empty, string.Empty, string.Empty, It.IsAny <MattermostVersion>()); var settingsLoadService = new Mock <ISettingsLoadService>(); settingsLoadService.Setup(x => x.Load()).Returns(settings); var classUnderTest = new MailItemContextMenuEntry( Mock.Of <IMailExplorer>(), settingsLoadService.Object, Mock.Of <ISettingsSaveService>(), Mock.Of <IErrorDisplay>(), Mock.Of <ISettingsUserInterface>(), Mock.Of <ISessionRepository>(), Mock.Of <IStringProvider>()); var result = classUnderTest.GetDynamicMenu(Mock.Of <IRibbonControl>()); result.Should() .WithNamespace("ns", "http://schemas.microsoft.com/office/2009/07/customui") .ContainXmlNode(@"//ns:button[contains(@label, ""Settings..."")]", "because there should always be a settings button"); result.Should() .WithNamespace("ns", "http://schemas.microsoft.com/office/2009/07/customui") .ContainXmlNode(@"//ns:button[contains(@onAction, ""OnSettingsClick"")]", "because the settings button should be connected to the 'OnSettingsClick'-Method"); }
public async Task RestoreSession_DisablesCertificateValidator_IfWebExceptionIsTrustFailureAndUserContinues() { var mattermost = new Mock <IClient>(); var session = new Mock <ISession>(); var clientfactory = SetupClientFactoryMock(mattermost); var exception = new WebException("", new Exception("invalid ssl"), WebExceptionStatus.TrustFailure, It.IsAny <HttpWebResponse>()); var certValidator = new Mock <IServerCertificateValidator>(); mattermost.SetupSequence( x => x.LoginByUsername(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())) .Throws(exception) .Returns(session.Object); var settingsLoadService = new Mock <ISettingsLoadService>(); var settings = new AddInSettings("myUrl", "testTeamId", "Donald Duck", "channels", MattermostVersion.ApiVersionFour); settingsLoadService.Setup(x => x.Load()).Returns(settings); var invalidSslQuestion = new Mock <ITrustInvalidSslQuestion>(); invalidSslQuestion.Setup(x => x.GetAnswer(settings.MattermostUrl, exception.InnerException.Message)) .Returns(true); var cut = new SingleSignOnSessionRepository(clientfactory.Object, settingsLoadService.Object, new Mock <IPasswordProvider>().Object, invalidSslQuestion.Object, certValidator.Object); var result = await cut.RestoreSession(); result.ShouldBeEquivalentTo(session.Object); certValidator.Verify(x => x.DisableValidation()); }
public async Task RestoreSession_CreatesNewSession_IfCacheInvalidated() { var mattermost = new Mock <IClient>(); var session1 = new Mock <ISession>(); var session2 = new Mock <ISession>(); var settingsLoadService = new Mock <ISettingsLoadService>(); var settings = new AddInSettings("myUrl", "testTeamId", "Donald Duck", "channels", MattermostVersion.ApiVersionOne); settingsLoadService.Setup(x => x.Load()).Returns(settings); var clientFactory = SetupClientFactoryMock(mattermost); mattermost.SetupSequence( x => x.LoginByUsername(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())) .Returns(session1.Object) .Returns(session2.Object); var classUnderTest = new SingleSignOnSessionRepository(clientFactory.Object, settingsLoadService.Object, Mock.Of <IPasswordProvider>()); var result1 = await classUnderTest.RestoreSession(); classUnderTest.Invalidate(); var result2 = await classUnderTest.RestoreSession(); result1.Should().Be(session1.Object); result2.Should().Be(session2.Object); }
public async Task RestoreSession_ReturnsNewSessionFromClient() { var settingsLoadService = new Mock <ISettingsLoadService>(); var settings = new AddInSettings("myUrl", "testTeamId", "Donald Duck", "channels", It.IsAny <MattermostVersion>()); settingsLoadService.Setup(x => x.Load()).Returns(settings); var mattermost = new Mock <IClient>(); var clientFactory = SetupClientFactoryMock(mattermost); var session = new Mock <ISession>(); mattermost.Setup( x => x.LoginByUsername(settings.MattermostUrl, settings.TeamId, settings.Username, It.IsAny <string>())) .Returns(session.Object); var classUnderTest = new SingleSignOnSessionRepository(clientFactory.Object, settingsLoadService.Object, Mock.Of <IPasswordProvider>(), Mock.Of <ITrustInvalidSslQuestion>(), Mock.Of <IServerCertificateValidator>()); var result = await classUnderTest.RestoreSession(); result.Should().Be(session.Object); }
public void RestoreSession_ThrowsUserAbortException_IfUserAbortsOnTrustFailureException() { var mattermost = new Mock <IClient>(); var session = new Mock <ISession>(); var clientfactory = SetupClientFactoryMock(mattermost); var exception = new WebException("", new Exception("invalid ssl"), WebExceptionStatus.TrustFailure, It.IsAny <HttpWebResponse>()); mattermost.SetupSequence( x => x.LoginByUsername(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())) .Throws(exception) .Returns(session.Object); var settingsLoadService = new Mock <ISettingsLoadService>(); var settings = new AddInSettings("myUrl", "testTeamId", "Donald Duck", "channels", MattermostVersion.ApiVersionFour); settingsLoadService.Setup(x => x.Load()).Returns(settings); var invalidSslQuestion = new Mock <ITrustInvalidSslQuestion>(); invalidSslQuestion.Setup(x => x.GetAnswer(settings.MattermostUrl, exception.InnerException.Message)) .Returns(false); var cut = new SingleSignOnSessionRepository(clientfactory.Object, settingsLoadService.Object, new Mock <IPasswordProvider>().Object, invalidSslQuestion.Object, new Mock <IServerCertificateValidator>().Object); Func <Task> func = async() => { await cut.RestoreSession(); }; func.ShouldThrow <UserAbortException>(); }
public WelcomeWizard(AddInSettings settings) { InitializeComponent(); m_settings = settings; wizard1.CancelEnabled = false; envGroupMaven2 = lstEnvironment.Groups.Add("Maven 2", "Maven 2"); envGroupJava = lstEnvironment.Groups.Add("Java 5", "Java 5"); envGroupUmlTools = lstEnvironment.Groups.Add("UML Tools", "UML Tools"); //envGroupMaven1 = lstEnvironment.Groups.Add("Maven 1 (optional)", "Maven 1 (optional)"); itemMaven2Install = new Maven2InstallCheck(envGroupMaven2); itemMaven2SettingsXml = new Maven2SettingsCheck(envGroupMaven2, m_settings); itemJavaHome = new JavaHomeCheck(envGroupJava); itemJRE = new JRECheck(envGroupJava); itemMagicDraw = new UmlModelerCheck(envGroupUmlTools, m_settings); //itemMaven1Install = new Maven1InstallCheck(envGroupMaven1); //itemMavenHomeCheck = new MavenHomeCheck(envGroupMaven1); //itemMaven1BuildProperties = new Maven1SettingsCheck(envGroupMaven1, m_settings); lstEnvironment.Items.AddRange(new ListViewItem[] { itemMaven2Install, itemMaven2SettingsXml, itemJavaHome, itemJRE, itemMagicDraw //itemMavenHomeCheck, //itemMaven1Install, //itemMaven1BuildProperties, }); }
public MDASolutionWizard(DTE applicationObject, MDASolutionManager solutionManager, AddInSettings settings) { m_applicationObject = applicationObject; m_solutionManager = solutionManager; m_settings = settings; InitializeComponent(); }
protected bool Equals(AddInSettings other) { return(string.Equals(MattermostUrl, other.MattermostUrl) && string.Equals(TeamId, other.TeamId) && string.Equals(Username, other.Username) && string.Equals(ChannelsMap, other.ChannelsMap) && string.Equals(Version, other.Version)); }
public MDASolutionWizard(DTE applicationObject, MDASolutionManager solutionManager, AddInSettings settings) { m_applicationObject = applicationObject; m_solutionManager = solutionManager; m_settings = settings; InitializeComponent(); }
public void GetDynamicMenu_ReturnZeroChannelButtons_IfSettingsHasNoChannelsSaved() { const string subscribedChannelAttribut = "OnPostIntoChannelClick"; var channels = string.Empty; var settings = new AddInSettings("http://localhost", "teamId", "username", channels, It.IsAny <MattermostVersion>()); var settingsLoadService = new Mock <ISettingsLoadService>(); settingsLoadService.Setup(x => x.Load()).Returns(settings); var classUnderTest = new MailItemContextMenuEntry( Mock.Of <IMailExplorer>(), settingsLoadService.Object, Mock.Of <ISettingsSaveService>(), Mock.Of <IErrorDisplay>(), Mock.Of <ISettingsUserInterface>(), Mock.Of <ISessionRepository>(), Mock.Of <IStringProvider>()); var result = classUnderTest.GetDynamicMenu(Mock.Of <IRibbonControl>()); result.Should() .WithNamespace("ns", "http://schemas.microsoft.com/office/2009/07/customui") .DoNotContainXmlNode(@"//ns:button[contains(@onAction, """ + subscribedChannelAttribut + @""")]", "because there should be one button for each channel"); }
public PropertyMapperDialog(CodeFunction2 currentMethod, AddInSettings settings) { InitializeComponent(); m_currentMethod = currentMethod; this.KeyPreview = true; m_codeToInsert = string.Empty; m_addInSettings = settings; }
public PropertyMapperDialog(CodeFunction2 currentMethod, AddInSettings settings) { InitializeComponent(); m_currentMethod = currentMethod; this.KeyPreview = true; m_codeToInsert = string.Empty; m_addInSettings = settings; }
public void Equals_ReturnsTrue_IfReferenceEqual() { var classUnderTest = new AddInSettings(string.Empty, string.Empty, string.Empty, string.Empty, It.IsAny <MattermostVersion>()); var result = classUnderTest.Equals(classUnderTest); result.Should().BeTrue(); }
public void GetHashCode_ReturnsSameHashCodeIfAllMembersAreNull() { var otherSettings = new AddInSettings(null, null, null, null, It.IsAny <MattermostVersion>()); var classUnderTest = new AddInSettings(null, null, null, null, It.IsAny <MattermostVersion>()); var result = classUnderTest.GetHashCode(); result.Should().Be(otherSettings.GetHashCode()); }
public void Equals_ReturnsFalse_IfObjectTypeDoesNotMatch(object other) { var classUnderTest = new AddInSettings(string.Empty, string.Empty, string.Empty, string.Empty, It.IsAny <MattermostVersion>()); var result = classUnderTest.Equals(other); result.Should().BeFalse(); }
public void Save_ReturnsSaveCommand() { var settings = new AddInSettings("http://localhost", "teamId", "username", "channels", It.IsAny <MattermostVersion>()); var saveCommand = new Mock <ICommand>(); var classUnderTest = new SettingsViewModel(settings, saveCommand.Object, Mock.Of <ICommand>()); var result = classUnderTest.Save; result.Should().Be(saveCommand.Object, "because the view model should return the save command for binding"); }
public void Username_ReturnsUsernameFromSettingsProvider() { var settings = new AddInSettings("http://localhost", "teamId", "username", "channels", It.IsAny <MattermostVersion>()); var classUnderTest = new SettingsViewModel(settings, Mock.Of <ICommand>(), Mock.Of <ICommand>()); var result = classUnderTest.Username; result.Should() .Be(settings.Username, "because the returned user name should come from the settings provider"); }
public void TestGenerateSchemas() { var ccRepository = CctsRepositoryFactory.CreateCctsRepository(new EARepository2()); var docLibrary = ccRepository.GetDocLibraryByPath((Path)"test model" / "bLibrary" / "DOCLibrary"); string outputDirectory = PathToTestResource( "\\XSDExporterTest\\cctsndr\\all"); AddInSettings.LoadRegistryEntries(); VIENNAAddIn.upcc3.export.cctsndr.XSDGenerator.GenerateSchemas(new GeneratorContext(ccRepository, "urn:test:namespace", "test", true, true, outputDirectory, docLibrary)); }
public void Load_ReturnsSavedSettings() { var classUnderTest = new ApplicationSettingsService(Mock.Of <ICache>()); var settings = new AddInSettings("url42", "teamId42", "username42", "channelMap", MattermostVersion.ApiVersionOne); classUnderTest.SaveCredentials("url42", "teamId42", "username42", MattermostVersion.ApiVersionOne); classUnderTest.SaveChannels("channelMap"); var loaded = classUnderTest.Load(); loaded.Should().Be(settings); }
public void OnAfterCreated(DTE DTEObject) { m_settings = new AddInSettings(DTEObject); cbUseOfflineMode.Checked = m_settings.MavenUseOfflineMode; cbUseClean.Checked = m_settings.MavenCleanFirst; cbUseCustomCommandLine.Checked = m_settings.MavenUseCustomCommandLine; txtCustomCommandLine.Text = m_settings.MavenCustomCommandLine; txtMagicDrawPath.Text = m_settings.UMLModellerPath; cbMakeModelWritable.Checked = m_settings.AutoMakeModelFileWritable; cbPassSchemaExportArguments.Checked = m_settings.PassSchemaExportArguments; txtSchemaExportCommandLine.Text = m_settings.SchemaExportCommandLine; UpdateState(); }
public void OnAfterCreated(DTE DTEObject) { m_settings = new AddInSettings(DTEObject); cbUseOfflineMode.Checked = m_settings.MavenUseOfflineMode; cbUseClean.Checked = m_settings.MavenCleanFirst; cbUseCustomCommandLine.Checked = m_settings.MavenUseCustomCommandLine; txtCustomCommandLine.Text = m_settings.MavenCustomCommandLine; txtMagicDrawPath.Text = m_settings.UMLModellerPath; cbMakeModelWritable.Checked = m_settings.AutoMakeModelFileWritable; cbPassSchemaExportArguments.Checked = m_settings.PassSchemaExportArguments; txtSchemaExportCommandLine.Text = m_settings.SchemaExportCommandLine; UpdateState(); }
public void TestSchemaGenerator() { using (var tempFileBasedRepository = new TemporaryFileBasedRepository(TestUtils.PathToTestResource("cc-for-ebInterface-0.5.eap"))) { var ccRepository = CctsRepositoryFactory.CreateCctsRepository(tempFileBasedRepository); var docLibrary = ccRepository.GetDocLibraryByPath((Path)"Model" / "ebInterface Data Model" / "DOCLibrary"); AddInSettings.LoadRegistryEntries(); var context = VIENNAAddIn.upcc3.export.cctsndr.XSDGenerator.GenerateSchemas(new GeneratorContext(ccRepository, "ebInterface", "eb", false, true, "C:\\dump\\", docLibrary)); Assert.AreEqual(5, context.Schemas.Count); XmlSchema schema = context.Schemas[1].Schema; schema.Write(Console.Out); } }
/// <summary> /// Connect /// </summary> /// <param name="repository"></param> /// <returns></returns> public string EA_Connect(Repository repository) { try { AddInSettings.LoadRegistryEntries(); } catch (Exception e) { String err = string.Format("Error loading settings from registry:\n{0}.\n Please reinstall the AddIn.", e.Message); MessageBox.Show(err, "AddIn Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(null); }
public void OnAfterCreated(DTE DTEObject) { m_settings = new AddInSettings(DTEObject); m_showAboutButton.Checked = m_settings.ShowAboutButton;; m_showSchemaExportButton.Checked = m_settings.ShowOpenModelButton; m_hideSchemaExportButton.Checked = m_settings.ShowSchemaExportButton; m_showOpenModelButton.Checked = m_settings.HideSchemaExportButtonIfProjectUnavailable; m_showResyncButton.Checked = m_settings.ShowResyncButton; m_promptOnBuildOutOfDate.Checked = m_settings.PromptToGenerateOnBuildIfFilesOutOfDate; m_promptOnBuildSynched.Checked = m_settings.PromptToGenerateOnBuildIfSolutionNotSynched; m_showWelcomeDialog.Checked = m_settings.ShowWelcomeWizard; m_enableCodeGenOnConversionMethods.Checked = m_settings.OnlyEnableCodeGenOnConversionMethods; m_enableCodeGenInDaoImpl.Checked = m_settings.OnlyEnableCodeGenInDaoImpl; m_showInsertConversion.Checked = m_settings.ShowInsertEntityConversion; m_showPropertyMapper.Checked = m_settings.ShowPropertyMapper; m_autoMapOnOpenMapper.Checked = m_settings.PropertyMapperAutoMapOnOpen; lstOptions.Groups.Add(m_generalGroup); lstOptions.Groups.Add(m_toolbarGroup); lstOptions.Groups.Add(m_contextGroup); lstOptions.Items.AddRange(new ListViewItem[] { m_promptOnBuildOutOfDate, m_promptOnBuildSynched, m_showWelcomeDialog, m_showAboutButton, m_showSchemaExportButton, m_hideSchemaExportButton, m_showOpenModelButton, m_showResyncButton, m_enableCodeGenOnConversionMethods, m_enableCodeGenInDaoImpl, m_showPropertyMapper, m_showInsertConversion, m_autoMapOnOpenMapper } ); // Set the tooltips foreach (ListViewItem item in lstOptions.Items) { item.ToolTipText = item.Name; } UpdateState(); }
public void OnAfterCreated(DTE DTEObject) { m_settings = new AddInSettings(DTEObject); m_showAboutButton.Checked = m_settings.ShowAboutButton;; m_showSchemaExportButton.Checked = m_settings.ShowOpenModelButton; m_hideSchemaExportButton.Checked = m_settings.ShowSchemaExportButton; m_showOpenModelButton.Checked = m_settings.HideSchemaExportButtonIfProjectUnavailable; m_showResyncButton.Checked = m_settings.ShowResyncButton; m_promptOnBuildOutOfDate.Checked = m_settings.PromptToGenerateOnBuildIfFilesOutOfDate; m_promptOnBuildSynched.Checked = m_settings.PromptToGenerateOnBuildIfSolutionNotSynched; m_showWelcomeDialog.Checked = m_settings.ShowWelcomeWizard; m_enableCodeGenOnConversionMethods.Checked = m_settings.OnlyEnableCodeGenOnConversionMethods; m_enableCodeGenInDaoImpl.Checked = m_settings.OnlyEnableCodeGenInDaoImpl; m_showInsertConversion.Checked = m_settings.ShowInsertEntityConversion; m_showPropertyMapper.Checked = m_settings.ShowPropertyMapper; m_autoMapOnOpenMapper.Checked = m_settings.PropertyMapperAutoMapOnOpen; lstOptions.Groups.Add(m_generalGroup); lstOptions.Groups.Add(m_toolbarGroup); lstOptions.Groups.Add(m_contextGroup); lstOptions.Items.AddRange(new ListViewItem[] { m_promptOnBuildOutOfDate, m_promptOnBuildSynched, m_showWelcomeDialog, m_showAboutButton, m_showSchemaExportButton, m_hideSchemaExportButton, m_showOpenModelButton, m_showResyncButton, m_enableCodeGenOnConversionMethods, m_enableCodeGenInDaoImpl, m_showPropertyMapper, m_showInsertConversion, m_autoMapOnOpenMapper } ); // Set the tooltips foreach (ListViewItem item in lstOptions.Items) { item.ToolTipText = item.Name; } UpdateState(); }
public void Equals_ChecksAllMembers(string urlModifier, string teamIdModifier, string usernameModifier, string channelMapModifier, bool expected) { const string url = "http://tempuri.org"; const string teamId = "team id"; const string username = "******"; const string channelMap = "channel map"; const MattermostVersion version = MattermostVersion.ApiVersionOne; var otherSettings = new AddInSettings(url + urlModifier, teamId + teamIdModifier, username + usernameModifier, channelMap + channelMapModifier, version); var classUnderTest = new AddInSettings(url, teamId, username, channelMap, version); var result = classUnderTest.Equals(otherSettings); result.Should().Be(expected); }
public void GetHashCode_CalculatesHashBasedOnMembers(string urlModifier, string teamIdModifier, string usernameModifier, string channelMapModifier, bool expected) { const string url = "http://tempuri.org"; const string teamId = "team id"; const string username = "******"; const string channelMap = "channel map"; const MattermostVersion version = MattermostVersion.ApiVersionOne; var otherSettings = new AddInSettings(url + urlModifier, teamId + teamIdModifier, username + usernameModifier, channelMap + channelMapModifier, version); var classUnderTest = new AddInSettings(url, teamId, username, channelMap, version); var result = classUnderTest.GetHashCode() == otherSettings.GetHashCode(); result.Should().Be(expected); }
public void GetDynamicMenu_ReturnsPostButton_ForSubscribedChannel() { const string channelButtonIdPrefix = "channel_id-"; const string channelName = "FunnyChannelName"; const string channelId = "1234"; const ChannelType publicChannel = ChannelType.Public; var channelList = new ChannelList { Channels = new List <Channel> { new Channel { ChannelName = channelName, ChannelId = channelId, Type = publicChannel } } }; var channels = JsonConvert.SerializeObject(channelList); var settings = new AddInSettings("http://localhost", "teamId", "username", channels, It.IsAny <MattermostVersion>()); var settingsLoadService = new Mock <ISettingsLoadService>(); settingsLoadService.Setup(x => x.Load()).Returns(settings); var classUnderTest = new MailItemContextMenuEntry( Mock.Of <IMailExplorer>(), settingsLoadService.Object, Mock.Of <ISettingsSaveService>(), Mock.Of <IErrorDisplay>(), Mock.Of <ISettingsUserInterface>(), Mock.Of <ISessionRepository>(), Mock.Of <IStringProvider>()); var result = classUnderTest.GetDynamicMenu(Mock.Of <IRibbonControl>()); result.Should() .WithNamespace("ns", "http://schemas.microsoft.com/office/2009/07/customui") .ContainXmlNode(@"//ns:button[contains(@label, ""FunnyChannelName"")]", "because there should be one button for each channel"); result.Should() .WithNamespace("ns", "http://schemas.microsoft.com/office/2009/07/customui") .ContainXmlNode(@"//ns:button[contains(@id, """ + channelButtonIdPrefix + channelId + @""")]", "because the tag of the button should match the channelId"); }
public void GetDynamicMenu_ReturnsNoChannelButtons_IfChannelTypeIsDirect() { const string channelName = "FunnyChannelName"; const string channelId = "1234"; const ChannelType directChannel = ChannelType.Direct; const string subscribedChannelAttribut = "OnPostIntoChannelClick"; var channelList = new ChannelList { Channels = new List <Channel> { new Channel { ChannelName = channelName, ChannelId = channelId, Type = directChannel } } }; var channels = JsonConvert.SerializeObject(channelList); var settings = new AddInSettings("http://localhost", "teamId", "username", channels, It.IsAny <MattermostVersion>()); var settingsLoadService = new Mock <ISettingsLoadService>(); settingsLoadService.Setup(x => x.Load()).Returns(settings); var classUnderTest = new MailItemContextMenuEntry( Mock.Of <IMailExplorer>(), settingsLoadService.Object, Mock.Of <ISettingsSaveService>(), Mock.Of <IErrorDisplay>(), Mock.Of <ISettingsUserInterface>(), Mock.Of <ISessionRepository>(), Mock.Of <IStringProvider>()); var result = classUnderTest.GetDynamicMenu(Mock.Of <IRibbonControl>()); result.Should() .WithNamespace("ns", "http://schemas.microsoft.com/office/2009/07/customui") .DoNotContainXmlNode(@"//ns:button[contains(@onAction, """ + subscribedChannelAttribut + @""")]", "because there should be one button for each channel"); }
public void OnAfterCreated(DTE DTEObject) { m_settings = new AddInSettings(DTEObject); lstResyncIgnoreList.Items.Clear(); if (m_settings.ResyncIgnoreList.Length > 0) { string[] list = m_settings.ResyncIgnoreList.Split(new char[] { ';' }); foreach (string item in list) { if (item.Length > 0) { lstResyncIgnoreList.Items.Add(item); } } } txtResyncIgnoreList.Text = string.Empty; btnAddResyncIgnoreItem.Enabled = false; btnDeleteResyncIgnoreItem.Enabled = false; cbIgnoreHiddenFiles.Checked = m_settings.ResyncIgnoreHiddenFiles; lstSyncFolders.Items.Clear(); if (m_settings.SyncFolderList.Length > 0) { string[] list = m_settings.SyncFolderList.Split(new char[] { ';' }); foreach (string item in list) { if (item.Length > 0) { lstSyncFolders.Items.Add(item); } } } txtSyncFolder.Text = string.Empty; btnAddSyncFolderItem.Enabled = false; btnDeleteSyncFolderItem.Enabled = false; }
public Maven1SettingsCheck(ListViewGroup group, AddInSettings settings) : base("Configuration", group) { m_settings = settings; }
public Maven2SettingsCheck(ListViewGroup group, AddInSettings settings) : base("Settings.xml", group) { m_addInSettings = settings; }
public UmlModelerCheck(ListViewGroup group, AddInSettings settings) : base("UML Modeler", group) { m_addInSettings = settings; }
public Maven1SettingsCheck(AddInSettings settings) { m_settings = settings; }
public Maven2SettingsCheck(AddInSettings settings) { m_addInSettings = settings; }
public Maven1SettingsCheck(ListViewGroup group, AddInSettings settings) : base("Configuration", group) { m_settings = settings; }
public Maven1SettingsCheck(AddInSettings settings) { m_settings = settings; }
public UmlModelerCheck(ListViewGroup group, AddInSettings settings) : base("UML Modeler", group) { m_addInSettings = settings; }
public Maven2SettingsCheck(ListViewGroup group, AddInSettings settings) : base("Settings.xml", group) { m_addInSettings = settings; }