private static string?GetDefaultPipeName() { // BaseDirectory was mistakenly marked as nullable in 3.1 // https://github.com/dotnet/runtime/pull/32486 var clientDirectory = AppDomain.CurrentDomain.BaseDirectory !; return(BuildServerConnection.GetPipeNameForPath(clientDirectory)); }
public void GetPipeNameForPathOptLength() { var path = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar); var name = BuildServerConnection.GetPipeNameForPath(path); // We only have ~50 total bytes to work with on mac, so the base path must be small Assert.Equal(43, name.Length); }
public void GetPipeNameForPathOptSlashes() { var path = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar); var name = BuildServerConnection.GetPipeNameForPath(path); Assert.Equal(name, BuildServerConnection.GetPipeNameForPath(path)); Assert.Equal(name, BuildServerConnection.GetPipeNameForPath(path + Path.DirectorySeparatorChar)); Assert.Equal(name, BuildServerConnection.GetPipeNameForPath(path + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar)); }