private static void UpdateProfile(PluginProfileDto pluginProfileDto)
        {
            var command = new ExecutePluginCommandCommand
            {
                CommandName = EmbeddedPluginCommands.AddOrUpdateProfile,
                Arguments   = pluginProfileDto.Serialize()
            };

            ObjectFactory.GetInstance <TransportMock>().HandleMessageFromTp(command);
        }
        private void UpdateProfile(MashupManagerProfile managerProfile)
        {
            var addOrUpdateProfileCommand = ObjectFactory.GetInstance <AddOrUpdateProfileCommand>();
            var profileDto = new PluginProfileDto
            {
                Name     = ProfileName,
                Settings = managerProfile
            };

            addOrUpdateProfileCommand.Execute(profileDto.Serialize());
        }
        public void CreateProfile(string profileName, string accountName)
        {
            var profileDto = new PluginProfileDto {Name = profileName, Settings = new SampleProfileSerialized()};
            var createProfileCmd = new ExecutePluginCommandCommand { CommandName = EmbeddedPluginCommands.AddProfile, Arguments = profileDto.Serialize() };

            _transportMock.HandleMessageFromTp(
                new List<HeaderInfo> {new HeaderInfo {Key = BusExtensions.ACCOUNTNAME_KEY, Value = accountName}}, createProfileCmd);

            var profile = ObjectFactory.GetInstance<IAccountCollection>().GetOrCreate(accountName).Profiles[profileName];
            profile.MarkAsInitialized();
            profile.Save();
        }
		public void ExecuteCommand(string commandName, string account, string profileName)
		{
			var profile = new PluginProfileDto { Name = profileName, Settings = new SampleProfileSerialized() };
			var cmd = new ExecutePluginCommandCommand { CommandName = commandName, Arguments = profile.Serialize() };
			Context.TransportMock.HandleMessageFromTp(
				new List<HeaderInfo>
					{
						new HeaderInfo {Key = BusExtensions.ACCOUNTNAME_KEY, Value = account},
						new HeaderInfo {Key = BusExtensions.PROFILENAME_KEY, Value = profileName}
					},
				cmd);
		}
		public void ShouldBeAbleToSerializeProfile()
		{
			TransportMock.CreateWithoutStructureMapClear(typeof (SampleProfileSerialized).Assembly);
			var pluginProfile = new PluginProfileDto
			                    	{
			                    		Name = "TestProfile",
			                    		Settings = new SampleProfileSerialized {StringValue = "components"}
			                    	};

			var serializedProfile = pluginProfile.Serialize();
			var deserializedProfile = serializedProfile.DeserializeProfile();

			deserializedProfile.Name.Should(Be.EqualTo("TestProfile"), "deserializedProfile.Name.Should(Be.EqualTo(\"TestProfile\"))");
			deserializedProfile.Settings.Should(Be.Not.Null, "Settings weren't deserialized");
			var settings = (SampleProfileSerialized) deserializedProfile.Settings;
			settings.StringValue.Should(Be.EqualTo("components"), "settings.StringValue.Should(Be.EqualTo(\"components\"))");
		}
        private void CreateProfileInitialization(ProjectEmailProfile settings, string profileName)
        {
            var profile = new PluginProfileDto
            {
                Name     = profileName,
                Settings = settings
            };

            var createProfileCmd = new ExecutePluginCommandCommand
            {
                CommandName = EmbeddedPluginCommands.AddProfile, Arguments = profile.Serialize()
            };

            _transportMock.HandleMessageFromTp(
                new List <HeaderInfo> {
                new HeaderInfo {
                    Key = BusExtensions.ACCOUNTNAME_KEY, Value = "Account"
                }
            }, createProfileCmd);
        }
Beispiel #7
0
        public void SetStringValue(string profileName, string stringValue, string accountName)
        {
            var profileUpdated = new PluginProfileDto
            {
                Name = profileName, Settings = new SampleProfileSerialized {
                    StringValue = stringValue
                }
            };
            var addOrUpdateProfileCmd = new ExecutePluginCommandCommand {
                CommandName = EmbeddedPluginCommands.AddOrUpdateProfile, Arguments = profileUpdated.Serialize()
            };

            _transportMock.HandleMessageFromTp(
                new List <HeaderInfo> {
                new HeaderInfo {
                    Key = BusExtensions.ACCOUNTNAME_KEY, Value = accountName
                }
            },
                addOrUpdateProfileCmd);
        }
        public void ShouldBeAbleToSerializeProfile()
        {
            TransportMock.CreateWithoutStructureMapClear(typeof(SampleProfileSerialized).Assembly);
            var pluginProfile = new PluginProfileDto
            {
                Name     = "TestProfile",
                Settings = new SampleProfileSerialized {
                    StringValue = "components"
                }
            };

            var serializedProfile   = pluginProfile.Serialize();
            var deserializedProfile = serializedProfile.DeserializeProfile();

            deserializedProfile.Name.Should(Be.EqualTo("TestProfile"));
            deserializedProfile.Settings.Should(Be.Not.Null, "Settings weren't deserialized");
            var settings = (SampleProfileSerialized)deserializedProfile.Settings;

            settings.StringValue.Should(Be.EqualTo("components"));
        }
Beispiel #9
0
        public void CreateProfile(string profileName, string accountName)
        {
            var profileDto = new PluginProfileDto {
                Name = profileName, Settings = new SampleProfileSerialized()
            };
            var createProfileCmd = new ExecutePluginCommandCommand {
                CommandName = EmbeddedPluginCommands.AddProfile, Arguments = profileDto.Serialize()
            };

            _transportMock.HandleMessageFromTp(
                new List <HeaderInfo> {
                new HeaderInfo {
                    Key = BusExtensions.ACCOUNTNAME_KEY, Value = accountName
                }
            }, createProfileCmd);

            var profile = ObjectFactory.GetInstance <IAccountCollection>().GetOrCreate(accountName).Profiles[profileName];

            profile.MarkAsInitialized();
            profile.Save();
        }
        public void ExecuteCommand(string commandName, string account, string profileName)
        {
            var profile = new PluginProfileDto {
                Name = profileName, Settings = new SampleProfileSerialized()
            };
            var cmd = new ExecutePluginCommandCommand {
                CommandName = commandName, Arguments = profile.Serialize()
            };

            Context.TransportMock.HandleMessageFromTp(
                new List <HeaderInfo>
            {
                new HeaderInfo {
                    Key = BusExtensions.ACCOUNTNAME_KEY, Value = account
                },
                new HeaderInfo {
                    Key = BusExtensions.PROFILENAME_KEY, Value = profileName
                }
            },
                cmd);
        }
        public void ModifyJiraUrlByPlugin(string profileName, string accountName, string jiraUrl)
        {
            var account = ObjectFactory.GetInstance <IAccountRepository>().GetAll().First(x => x.Name == accountName);
            var context = ObjectFactory.GetInstance <PluginContextMock>();

            context.ProfileName = profileName;
            context.AccountName = account.Name;
            ObjectFactory.GetInstance <IBus>().SetIn((ProfileName)profileName);
            ObjectFactory.GetInstance <IBus>().SetIn(account.Name);

            var profile =
                ObjectFactory.GetInstance <IAccountCollection>().GetOrCreate(context.AccountName).Profiles[context.ProfileName].
                GetProfile <SampleJiraProfile>();

            profile.JiraUrl = jiraUrl;

            var updatedProfileDto = new PluginProfileDto {
                Name = context.ProfileName.Value, Settings = profile
            };

            ObjectFactory.GetInstance <AddOrUpdateProfileCommand>().Execute(updatedProfileDto.Serialize());
        }
        public void SetSyncInterval(string profileName, string accountName, int syncInterval)
        {
            var currentProfileDto = new PluginProfileDto
            {
                Name     = profileName,
                Settings = new SampleProfileSerialized {
                    SynchronizationInterval = syncInterval
                }
            };
            var createProfileCmd = new ExecutePluginCommandCommand
            {
                CommandName = EmbeddedPluginCommands.AddOrUpdateProfile,
                Arguments   = currentProfileDto.Serialize()
            };

            ObjectFactory.GetInstance <TransportMock>().HandleMessageFromTp(
                new List <HeaderInfo> {
                new HeaderInfo {
                    Key = BusExtensions.ACCOUNTNAME_KEY, Value = accountName
                }
            }, createProfileCmd);
        }
 private void CheckReturnedProfile(PluginProfileDto profileDto)
 {
     _response.ResponseData.Should(Be.EqualTo(profileDto.Serialize()));
 }
        private static void UpdateProfile(PluginProfileDto pluginProfileDto)
        {
            var command = new ExecutePluginCommandCommand
            {
                CommandName = EmbeddedPluginCommands.AddOrUpdateProfile,
                Arguments = pluginProfileDto.Serialize()
            };

            ObjectFactory.GetInstance<TransportMock>().HandleMessageFromTp(command);
        }
		public void SetStringValue(string profileName, string stringValue, string accountName)
		{
			var profileUpdated = new PluginProfileDto
			                     	{Name = profileName, Settings = new SampleProfileSerialized {StringValue = stringValue}};
			var addOrUpdateProfileCmd = new ExecutePluginCommandCommand { CommandName = EmbeddedPluginCommands.AddOrUpdateProfile, Arguments = profileUpdated.Serialize() };
			_transportMock.HandleMessageFromTp(
				new List<HeaderInfo> {new HeaderInfo {Key = BusExtensions.ACCOUNTNAME_KEY, Value = accountName}},
				addOrUpdateProfileCmd);
		}
        private void CreateProfileInitialization(ProjectEmailProfile settings, string profileName)
        {
            var profile = new PluginProfileDto
                          	{
                          		Name = profileName,
                          		Settings = settings
                          	};

            var createProfileCmd = new ExecutePluginCommandCommand
                                   	{CommandName = EmbeddedPluginCommands.AddProfile, Arguments = profile.Serialize()};
            _transportMock.HandleMessageFromTp(
                new List<HeaderInfo> {new HeaderInfo {Key = BusExtensions.ACCOUNTNAME_KEY, Value = "Account"}}, createProfileCmd);
        }
		public void SetSyncInterval(string profileName, string accountName, int syncInterval)
		{
			var currentProfileDto = new PluginProfileDto
			                        	{
			                        		Name = profileName,
			                        		Settings = new SampleProfileSerialized {SynchronizationInterval = syncInterval}
			                        	};
			var createProfileCmd = new ExecutePluginCommandCommand
			                       	{
			                       		CommandName = EmbeddedPluginCommands.AddOrUpdateProfile,
			                       		Arguments = currentProfileDto.Serialize()
			                       	};

			ObjectFactory.GetInstance<TransportMock>().HandleMessageFromTp(
				new List<HeaderInfo> {new HeaderInfo {Key = BusExtensions.ACCOUNTNAME_KEY, Value = accountName}}, createProfileCmd);
		}
        public void ModifyJiraUrlByPlugin(string profileName, string accountName, string jiraUrl)
        {
            var account = ObjectFactory.GetInstance<IAccountRepository>().GetAll().First(x => x.Name == accountName);
            var context = ObjectFactory.GetInstance<PluginContextMock>();

            context.ProfileName = profileName;
            context.AccountName = account.Name;
            ObjectFactory.GetInstance<IBus>().SetIn((ProfileName) profileName);
            ObjectFactory.GetInstance<IBus>().SetIn(account.Name);

            var profile = ObjectFactory.GetInstance<IAccountCollection>().GetOrCreate(context.AccountName).Profiles[context.ProfileName].GetProfile<SampleJiraProfile>();
            profile.JiraUrl = jiraUrl;

            var updatedProfileDto = new PluginProfileDto {Name = context.ProfileName.Value, Settings = profile};
            ObjectFactory.GetInstance<AddOrUpdateProfileCommand>().Execute(updatedProfileDto.Serialize());
        }
		private void UpdateProfile(MashupManagerProfile managerProfile)
		{
			var addOrUpdateProfileCommand = ObjectFactory.GetInstance<AddOrUpdateProfileCommand>();
			var profileDto = new PluginProfileDto
			{
				Name = ProfileName,
				Settings = managerProfile
			};
			addOrUpdateProfileCommand.Execute(profileDto.Serialize(), null);
		}
        private void CreateOrUpdateProfile(MashupNames names)
        {
            var command = ObjectFactory.GetInstance<AddOrUpdateProfileCommand>();

            var pluginProfileDto = new PluginProfileDto
            {
                Name = ProfileName,
                Settings = new MashupManagerProfile
                {
                    MashupNames = names
                }
            };

            command.Execute(pluginProfileDto.Serialize());
        }
 private void CheckReturnedProfile(PluginProfileDto profileDto)
 {
     _response.ResponseData.Should(Be.EqualTo(profileDto.Serialize()));
 }