public void ResolveProtocol_WorksCorrectly(int clientProtocol, int pluginProtocol, int expectedProtocol) { // Act var resolvedProtocol = ResolveProtocolCommand.ResolveProtocol(clientProtocol, pluginProtocol); // Assert Assert.Equal(expectedProtocol, resolvedProtocol); }
public static int Main(string[] args) { try { var app = new CommandLineApplication { Name = "razor-tooling", FullName = "Microsoft Razor Tooling Utility", Description = "Resolves Razor tooling specific information.", ShortVersionGetter = GetInformationalVersion, }; app.HelpOption("-?|-h|--help"); ResolveProtocolCommand.Register(app); if (DotnetToolDispatcher.IsDispatcher(args)) { ResolveTagHelpersCommandBase.Register <ResolveTagHelpersDispatchCommand>(app); } else { DotnetToolDispatcher.EnsureValidDispatchRecipient(ref args); ResolveTagHelpersCommandBase.Register <ResolveTagHelpersRunCommand>(app); } app.OnExecute(() => { app.ShowHelp(); return(2); }); return(app.Execute(args)); } catch (Exception ex) { Reporter.Error.WriteLine(ex.Message); return(1); } }