LCOV - code coverage report
Current view: top level - vs-net-core-template/CalculatorLibrary - Calculator.cs (source / functions) Coverage Total Hit
Test: Documentation Coverage Report Lines: 83.3 % 6 5
Test Date: 2026-09-30 03:06:01 Functions: - 0 0
Legend: Lines: hit not hit

            Line data    Source code
       1            0 : namespace CalculatorLibrary {
       2              : 
       3              : /// <summary>
       4              : /// Performs basic arithmetic operations on integers.
       5              : /// </summary>
       6              : /// <remarks>
       7              : /// This is the sample class the template ships with. When you start your own project, replace it
       8              : /// (and <see cref="CalculatorCli"/>) with your own domain classes — see
       9              : /// <c>docs/guide/from-topic-to-project.en.md</c> for the step-by-step walkthrough.
      10              : /// </remarks>
      11            1 : public class Calculator {
      12              :   /// <summary>Adds two integers.</summary>
      13              :   /// <param name="a">The first addend.</param>
      14              :   /// <param name="b">The second addend.</param>
      15              :   /// <returns>The sum of <paramref name="a"/> and <paramref name="b"/>.</returns>
      16            1 :   public int Add(int a, int b) {
      17              :     return a + b;
      18              :   }
      19              : 
      20              :   /// <summary>Subtracts one integer from another.</summary>
      21              :   /// <param name="a">The value to subtract from.</param>
      22              :   /// <param name="b">The value to subtract.</param>
      23              :   /// <returns>The result of <paramref name="a"/> minus <paramref name="b"/>.</returns>
      24            1 :   public int Subtract(int a, int b) {
      25              :     return a - b;
      26              :   }
      27              : 
      28              :   /// <summary>Multiplies two integers.</summary>
      29              :   /// <param name="a">The first factor.</param>
      30              :   /// <param name="b">The second factor.</param>
      31              :   /// <returns>The product of <paramref name="a"/> and <paramref name="b"/>.</returns>
      32            1 :   public int Multiply(int a, int b) {
      33              :     return a * b;
      34              :   }
      35              : 
      36              :   /// <summary>Divides one integer by another using integer (truncating) division.</summary>
      37              :   /// <param name="a">The dividend.</param>
      38              :   /// <param name="b">The divisor.</param>
      39              :   /// <returns>The integer quotient of <paramref name="a"/> divided by <paramref name="b"/>.</returns>
      40              :   /// <exception cref="DivideByZeroException">Thrown when <paramref name="b"/> is zero.</exception>
      41            1 :   public int Divide(int a, int b) {
      42              :     if (b == 0) {
      43              :       throw new DivideByZeroException();
      44              :     }
      45              : 
      46              :     return a / b;
      47              :   }
      48              : }
      49              : }
        

Generated by: LCOV version 2.0-1