public async Task JsonFormat_ShouldBeWellFormed() { Repository.Projects.FindByNames(Arg.Any <IEnumerable <string> >()).Returns(new List <ProjectResource> { new ProjectResource { Name = "ProjectA", Id = "projectaid" }, new ProjectResource { Name = "ProjectB", Id = "projectbid" }, new ProjectResource { Name = "Version controlled project", Id = VersionControlledProjectId } }); Repository.Releases.FindMany(Arg.Any <Func <ReleaseResource, bool> >()).Returns(new List <ReleaseResource> { new ReleaseResource { ProjectId = "projectaid", Version = "1.0", Assembled = DateTimeOffset.MinValue, ReleaseNotes = "Release Notes 1" }, new ReleaseResource { ProjectId = "projectaid", Version = "2.0", Assembled = DateTimeOffset.MaxValue, ReleaseNotes = "Release Notes 2" }, new ReleaseResource { ProjectId = "projectaid", Version = "whateverdockerversion", Assembled = DateTimeOffset.MaxValue, ReleaseNotes = "Release Notes 3" }, new ReleaseResource { ProjectId = VersionControlledProjectId, Version = "1.2.3", Assembled = DateTimeOffset.MaxValue, ReleaseNotes = "Version controlled release notes", VersionControlReference = new VersionControlReferenceResource { GitCommit = "87a072ad2b4a2e9bf2d7ff84d8636a032786394d", GitRef = "main" } } }); CommandLineArgs.Add("--project=ProjectA"); CommandLineArgs.Add("--outputFormat=json"); await listReleasesCommand.Execute(CommandLineArgs.ToArray()).ConfigureAwait(false); this.Assent(LogOutput.ToString().ScrubApprovalString()); }
public bool SetAdditionalLibPaths(string[] additionalLibPaths) { if (additionalLibPaths != null && additionalLibPaths.Length > 0) { CommandLineArgs.Add("/lib:\"" + string.Join(";", additionalLibPaths) + "\""); } return(true); }
public void ShouldNotCleanEnvironmentWithMissingStatusArgs() { CommandLineArgs.Add("-environment=Development"); Func <Task> exec = () => listMachinesCommand.Execute(CommandLineArgs.ToArray()); exec.ShouldThrow <CommandException>() .WithMessage("Please specify a status using the parameter: --status or --health-status"); }
public void ShouldNotCleanPoolWithMissingStatusArgs() { CommandLineArgs.Add("-workerpool=SomePool"); Func <Task> exec = () => cleanPoolCommand.Execute(CommandLineArgs.ToArray()); exec.ShouldThrow <CommandException>() .WithMessage("Please specify a status using the parameter: --health-status"); }
public bool SetModuleAssemblyName(string moduleAssemblyName) { if (!string.IsNullOrWhiteSpace(moduleAssemblyName)) { CommandLineArgs.Add("/moduleassemblyname:\"" + moduleAssemblyName + "\""); } return(true); }
public bool SetMainEntryPoint(string targetType, string mainEntryPoint) { if (!string.IsNullOrWhiteSpace(mainEntryPoint)) { CommandLineArgs.Add("/main:\"" + mainEntryPoint + "\""); } return(true); }
public bool SetAllowUnsafeBlocks(bool allowUnsafeBlocks) { if (allowUnsafeBlocks) { CommandLineArgs.Add("/unsafe"); } return(true); }
public bool SetWin32Resource(string win32Resource) { if (!string.IsNullOrWhiteSpace(win32Resource)) { CommandLineArgs.Add("/win32res:\"" + win32Resource + "\""); } return(true); }
public bool SetWarningsNotAsErrors(string warningsNotAsErrors) { if (!string.IsNullOrWhiteSpace(warningsNotAsErrors)) { CommandLineArgs.Add("/warnaserror-:" + warningsNotAsErrors); } return(true); }
public bool SetRuleSet(string ruleSetFile) { if (!string.IsNullOrWhiteSpace(ruleSetFile)) { CommandLineArgs.Add("/ruleset:\"" + ruleSetFile + "\""); } return(true); }
public bool SetOptimize(bool optimize) { if (optimize) { CommandLineArgs.Add("/optimize"); } return(true); }
public bool SetDisabledWarnings(string disabledWarnings) { if (!string.IsNullOrWhiteSpace(disabledWarnings)) { CommandLineArgs.Add("/nowarn:" + disabledWarnings); } return(true); }
public bool SetDelaySign(bool delaySignExplicitlySet, bool delaySign) { if (delaySignExplicitlySet) { CommandLineArgs.Add("/delaysign" + (delaySign ? "+" : "-")); } return(true); }
public bool SetDefineConstants(string defineConstants) { if (!string.IsNullOrWhiteSpace(defineConstants)) { CommandLineArgs.Add("/define:" + defineConstants); } return(true); }
public bool SetCodePage(int codePage) { if (codePage != 0) { CommandLineArgs.Add("/codepage:" + codePage); } return(true); }
public bool SetCheckForOverflowUnderflow(bool checkForOverflowUnderflow) { if (checkForOverflowUnderflow) { CommandLineArgs.Add("/checked"); } return(true); }
public bool SetBaseAddress(string baseAddress) { if (!string.IsNullOrWhiteSpace(baseAddress)) { CommandLineArgs.Add("/baseaddress:" + baseAddress); } return(true); }
public bool SetNoConfig(bool noConfig) { if (noConfig) { CommandLineArgs.Add("/noconfig"); } return(true); }
public bool SetNoStandardLib(bool noStandardLib) { if (noStandardLib) { CommandLineArgs.Add("/nostdlib"); } return(true); }
public bool SetDocumentationFile(string documentationFile) { if (!string.IsNullOrWhiteSpace(documentationFile)) { CommandLineArgs.Add("/doc:\"" + documentationFile + "\""); } return(true); }
public bool SetPdbFile(string pdbFile) { if (!string.IsNullOrWhiteSpace(pdbFile)) { CommandLineArgs.Add($"/pdb:\"{pdbFile}\""); } return(true); }
public bool SetErrorReport(string errorReport) { if (!string.IsNullOrWhiteSpace(errorReport)) { CommandLineArgs.Add("/errorreport:" + errorReport.ToLower()); } return(true); }
public bool SetTreatWarningsAsErrors(bool treatWarningsAsErrors) { if (treatWarningsAsErrors) { CommandLineArgs.Add("/warnaserror"); } return(true); }
public bool SetGenerateFullPaths(bool generateFullPaths) { if (generateFullPaths) { CommandLineArgs.Add("/fullpaths"); } return(true); }
public bool SetWin32Icon(string win32Icon) { if (!string.IsNullOrWhiteSpace(win32Icon)) { CommandLineArgs.Add("/win32icon:\"" + win32Icon + "\""); } return(true); }
public bool SetWin32Manifest(string win32Manifest) { if (!string.IsNullOrWhiteSpace(win32Manifest)) { CommandLineArgs.Add("/win32manifest:\"" + win32Manifest + "\""); } return(true); }
public bool SetKeyContainer(string keyContainer) { if (!string.IsNullOrWhiteSpace(keyContainer)) { CommandLineArgs.Add("/keycontainer:\"" + keyContainer + "\""); } return(true); }
public bool SetAddModules(string[] addModules) { if (addModules != null && addModules.Length > 0) { CommandLineArgs.Add("/addmodule:\"" + string.Join(";", addModules) + "\""); } return(true); }
public bool SetLangVersion(string langVersion) { if (!string.IsNullOrWhiteSpace(langVersion)) { CommandLineArgs.Add("/langversion:" + langVersion); } return(true); }
public bool SetApplicationConfiguration(string applicationConfiguration) { if (!string.IsNullOrWhiteSpace(applicationConfiguration)) { CommandLineArgs.Add("/appconfig:" + applicationConfiguration); } return(true); }
public IDisposable Play(MediaStreamInfo mediaStreamInfo, IPlaybackController playbackController) { //fix url var url = new Uri(mediaStreamInfo.url); if (url == null || !url.IsAbsoluteUri) { throw new Exception("Invalid playback url"); } if (mediaStreamInfo.transport != MediaStreamInfo.Transport.Http) { if (String.Compare(url.Scheme, "rtsp", true) != 0) { throw new Exception("Invalid playback url"); } } else if (String.Compare(url.Scheme, "rtsp", true) != 0) { int defPort; if (String.Compare(url.Scheme, Uri.UriSchemeHttp, true) == 0) { defPort = 80; } else if (String.Compare(url.Scheme, Uri.UriSchemeHttps, true) == 0) { defPort = 443; } else { throw new Exception("Invalid playback url"); } var ub = new UriBuilder(url); ub.Scheme = "rtsp"; if (ub.Port == -1) { ub.Port = defPort; } url = ub.Uri; mediaStreamInfo = new MediaStreamInfo(url.ToString(), mediaStreamInfo.transport, mediaStreamInfo.userNameToken); } var disposable = new SingleAssignmentDisposable(); playerTask.mediaStreamInfo = mediaStreamInfo; playerTask.playbackController = playbackController; if (playerHost != null) { playerHost.Dispose(); RemotingServices.Disconnect(playerHost); playerHost = null; } playerHost = new PlayerHost(playerTask); RemotingServices.Marshal(playerHost); var ipcChannel = AppHosting.SetupChannel(); var hostControllerUri = RemotingServices.GetObjectUri(playerHost); var hostControllerUrl = ipcChannel.GetUrlsForUri(hostControllerUri).First(); //start player host process var hostProcessArgs = new CommandLineArgs(); var t = Uri.EscapeDataString(hostControllerUrl); hostProcessArgs.Add("controller-url", new List<string> { hostControllerUrl }); var pi = new ProcessStartInfo() { FileName = Assembly.GetExecutingAssembly().Location, UseShellExecute = false, Arguments = String.Join(" ", hostProcessArgs.Format()), }; pi.EnvironmentVariables["PATH"] = String.Join("; ", Bootstrapper.specialFolders.dlls.Select(sfd => sfd.directory.FullName).Append(pi.EnvironmentVariables["PATH"])); StartHostProcess(pi); return Disposable.Create(() => { Dispose(); }); }