< Summary

Information
Class: CalculatorLibrary.Calculator
Assembly: CalculatorLibrary
File(s): D:\a\vs-net-core-template\vs-net-core-template\CalculatorLibrary\Calculator.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 49
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 9/30/2026 - 3:07:32 AM Line coverage: 100% (6/6) Branch coverage: 100% (2/2) Total lines: 49 9/30/2026 - 3:07:32 AM Line coverage: 100% (6/6) Branch coverage: 100% (2/2) Total lines: 49

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Add(...)100%11100%
Subtract(...)100%11100%
Multiply(...)100%11100%
Divide(...)100%22100%

File(s)

D:\a\vs-net-core-template\vs-net-core-template\CalculatorLibrary\Calculator.cs

#LineLine coverage
 1namespace 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>
 11public 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  public int Add(int a, int b) {
 2017    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  public int Subtract(int a, int b) {
 1225    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  public int Multiply(int a, int b) {
 1233    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  public int Divide(int a, int b) {
 2042    if (b == 0) {
 443      throw new DivideByZeroException();
 44    }
 45
 1646    return a / b;
 47  }
 48}
 49}