< Summary

Information
Class: D:\a\vs-net-core-template\vs-net-core-template\CalculatorApp\Program.cs
Assembly: Default
File(s): D:\a\vs-net-core-template\vs-net-core-template\CalculatorApp\Program.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 22
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

D:\a\vs-net-core-template\vs-net-core-template\CalculatorApp\Program.cs

#LineLine coverage
 01namespace CalculatorApp {
 2
 3/// <summary>
 4/// Console entry point. All parsing and calculation logic lives in
 5/// <see cref="CalculatorLibrary.CalculatorCli"/> so it is unit tested there; this class only wires
 6/// the process arguments to that logic and prints the result. It never calls
 7/// <c>Console.ReadLine</c> or otherwise waits on keyboard input, so it never blocks when launched
 8/// from a build script or CI.
 9/// </summary>
 10internal class Program {
 011  private static int Main(string[] args) {
 12    try {
 13      string output = args.Length == 0 ? CalculatorLibrary.CalculatorCli.RunDemo() : CalculatorLibrary.CalculatorCli.Run
 14      Console.WriteLine(output);
 15      return 0;
 16    } catch (Exception ex) when (ex is ArgumentException or DivideByZeroException) {
 17      Console.Error.WriteLine($"Error: {ex.Message}");
 18      return 1;
 19    }
 20  }
 21}
 22}

Methods/Properties