This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Theory] | |
| [InlineData(3, 3)] | |
| [InlineData(3, 6)] | |
| [InlineData(3, 9)] | |
| [InlineData(5, 5)] | |
| [InlineData(5, 10)] | |
| [InlineData(5, 15)] | |
| public void Multiple_ShouldSuccess(int y, int x) | |
| { | |
| Helpers.IsMultipleOf(y, x).ShouldBeTrue(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Fact] | |
| public void MultpleOf_ShouldThrowExpcetion() | |
| { | |
| Should.Throw<ArgumentException>(() => | |
| { | |
| Helpers.IsMultipleOf(0, 3); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Validadtes if a value is multiple of other number | |
| /// </summary> | |
| /// <param name="y">The desired multiple.</param> | |
| /// <param name="x">Value to check.</param> | |
| /// <returns>Returns true if value is multiple of multiple</returns> | |
| public static bool IsMultipleOf(int y, int x) | |
| { | |
| //Check possible DivisionByZero | |
| if (y == 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Shouldly; | |
| using Xunit; | |
| namespace Problems.Tests | |
| { | |
| public class HelpersTess | |
| { | |
| [Fact] | |
| public void Sum_ShouldBeSuccess() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Xunit; | |
| namespace Problems.Tests | |
| { | |
| public class HelpersTess | |
| { | |
| [Fact] | |
| public void Sum_ShouldBeSuccess() | |
| { | |
| // Helpers.Sum(1, 2).ShouldBe(3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Shouldly; | |
| using Xunit; | |
| namespace Problems.Tests | |
| { | |
| public class HelpersTess | |
| { | |
| [Fact] | |
| public void Sum_ShouldBeSuccess() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace Problems | |
| { | |
| public static class Helpers | |
| { | |
| /// <summary> | |
| /// Sums two numbers. | |
| /// </summary> | |
| /// <param name="a">First number.</param> | |
| /// <param name="b">Second number.</param> | |
| /// <returns>Returns the sum of two specified integer numbers.</returns> |
NewerOlder