public void ReceivePluginSpecificChangePluginProfileCommand(string commandName, string accountName, string profileName) { ObjectFactory.GetInstance<PluginContextMock>().AccountName = accountName; ObjectFactory.GetInstance<PluginContextMock>().ProfileName = profileName; var command = new ExecutePluginCommandCommand {CommandName = commandName, Arguments = new PluginProfileDto {Name = profileName}.Serialize()}; ObjectFactory.GetInstance<PluginCommandHandler>().Handle(command); }
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 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(); }
private static void UpdateProfile(PluginProfileDto pluginProfileDto) { var command = new ExecutePluginCommandCommand { CommandName = EmbeddedPluginCommands.AddOrUpdateProfile, Arguments = pluginProfileDto.Serialize() }; ObjectFactory.GetInstance<TransportMock>().HandleMessageFromTp(command); }
private void HandlePluginCommand(string commandName, string args) { var command = new ExecutePluginCommandCommand {CommandName = commandName, Arguments = args}; Context.Transport.TpQueue.Clear(); Context.Transport.HandleMessageFromTp(command); }
public void WhenProfileIsValidatedForMapping() { var args = new PluginProfileDto { Settings = _settings }.Serialize(); var command = new ExecutePluginCommandCommand { CommandName = "ValidateProfileForMapping", Arguments = args }; Context.Transport.TpQueue.Clear(); Context.Transport.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 SeleniumResultsCommandIsSent() { var command = new ExecutePluginCommandCommand { CommandName = "SeleniumResults", Arguments = ReadSeleniumResourceFileForCurrentProfile() }; Context.Transport.HandleMessageFromTp(Context.CurrentProfile, command); }
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); }