29 references to ParsePortError
containerize (7)
ContainerizeCommand.cs (7)
129var badPorts = new List<(string, ContainerHelpers.ParsePortError)>(); 142var pe = (ContainerHelpers.ParsePortError)portError!; 154var pe = (ContainerHelpers.ParsePortError)portError!; 160badPorts.Add((port, ContainerHelpers.ParsePortError.UnknownPortFormat)); 171var errors = Enum.GetValues<ContainerHelpers.ParsePortError>().Where(e => error.HasFlag(e));
Microsoft.NET.Build.Containers (16)
ContainerHelpers.cs (7)
58public static bool TryParsePort(string? portNumber, string? portType, [NotNullWhen(true)] out Port? port, [NotNullWhen(false)] out ParsePortError? error) 64error = ParsePortError.MissingPortNumber; 68error = ParsePortError.InvalidPortNumber; 75error = (error ?? ParsePortError.InvalidPortType) | ParsePortError.InvalidPortType; 104public static bool TryParsePort(string input, [NotNullWhen(true)] out Port? port, [NotNullWhen(false)] out ParsePortError? error) 120error = ParsePortError.UnknownPortFormat;
ImageConfig.cs (1)
241&& ContainerHelpers.TryParsePort(propertyName, out Port? parsedPort, out ContainerHelpers.ParsePortError? _))
Tasks\CreateNewImage.cs (8)
240if (ContainerHelpers.TryParsePort(portNo, portType, out Port? parsedPort, out ContainerHelpers.ParsePortError? errors)) 246ContainerHelpers.ParsePortError parsedErrors = (ContainerHelpers.ParsePortError)errors!; 248if (parsedErrors.HasFlag(ContainerHelpers.ParsePortError.MissingPortNumber)) 254if (parsedErrors.HasFlag(ContainerHelpers.ParsePortError.InvalidPortNumber) && parsedErrors.HasFlag(ContainerHelpers.ParsePortError.InvalidPortType)) 258else if (parsedErrors.HasFlag(ContainerHelpers.ParsePortError.InvalidPortNumber)) 262else if (parsedErrors.HasFlag(ContainerHelpers.ParsePortError.InvalidPortType))
Microsoft.NET.Build.Containers.UnitTests (6)
ContainerHelpersTests.cs (6)
114[InlineData("125/dup", false, 125, PortType.tcp, ContainerHelpers.ParsePortError.InvalidPortType)] 115[InlineData("invalidNumber", false, null, null, ContainerHelpers.ParsePortError.InvalidPortNumber)] 116[InlineData("welp/unknowntype", false, null, null, (ContainerHelpers.ParsePortError)6)] 117[InlineData("a/b/c", false, null, null, ContainerHelpers.ParsePortError.UnknownPortFormat)] 118[InlineData("/tcp", false, null, null, ContainerHelpers.ParsePortError.MissingPortNumber)] 119public void CanParsePort(string input, bool shouldParse, int? expectedPortNumber, PortType? expectedType, ContainerHelpers.ParsePortError? expectedError)