File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed
Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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
26Steeltoe.Common.Discovery.IServiceInstance.InstanceId.get -> string!
37Steeltoe.Common.Discovery.IServiceInstance.NonSecureUri.get -> System.Uri?
48Steeltoe.Common.Discovery.IServiceInstance.SecureUri.get -> System.Uri?
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments