Skip to content

Commit d14b393

Browse files
committed
TEST: Add new tests to verify coverage diff
1 parent 852881b commit d14b393

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace Steeltoe.Common;
6+
7+
public sealed class Calculator
8+
{
9+
public int Add(int left, int right)
10+
{
11+
if (left < 0 || right < 0)
12+
{
13+
throw new ArgumentException("Only non-negative integers are allowed.");
14+
}
15+
16+
return left + right;
17+
}
18+
19+
public int Subtract(int left, int right)
20+
{
21+
return left - right;
22+
}
23+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#nullable enable
2+
Steeltoe.Common.Calculator
3+
Steeltoe.Common.Calculator.Add(int left, int right) -> int
4+
Steeltoe.Common.Calculator.Calculator() -> void
5+
Steeltoe.Common.Calculator.Subtract(int left, int right) -> int
26
Steeltoe.Common.Discovery.IServiceInstance.InstanceId.get -> string!
37
Steeltoe.Common.Discovery.IServiceInstance.NonSecureUri.get -> System.Uri?
48
Steeltoe.Common.Discovery.IServiceInstance.SecureUri.get -> System.Uri?
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace Steeltoe.Common.Test;
6+
7+
public sealed class CalculatorTest
8+
{
9+
[Fact]
10+
public void Add_Returns_Correct_Sum()
11+
{
12+
var calculator = new Calculator();
13+
int result = calculator.Add(3, 5);
14+
result.Should().Be(8);
15+
}
16+
17+
[Fact(Skip = "ExampleSkippedTest")]
18+
public void SkippedTest()
19+
{
20+
true.Should().BeFalse();
21+
}
22+
}

0 commit comments

Comments
 (0)