diff --git a/README.md b/README.md index e853bca..52f79f7 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# UnitTesting \ No newline at end of file +# Danilov Bogacheva ispp35 diff --git a/UnitTesting/unV1RUS/Readme.md b/UnitTesting/unV1RUS/Readme.md new file mode 100644 index 0000000..d8daa50 --- /dev/null +++ b/UnitTesting/unV1RUS/Readme.md @@ -0,0 +1 @@ +Данилов Богачева испп 35 \ No newline at end of file diff --git a/UnitTesting/unV1RUS/basic.cs b/UnitTesting/unV1RUS/basic.cs new file mode 100644 index 0000000..ba0bdaa --- /dev/null +++ b/UnitTesting/unV1RUS/basic.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TestingLib.Math; + +namespace UnitTesting.unV1RUS +{ + public class BasicCalcTest + { + private readonly BasicCalc _calculator; + + public BasicCalcTest() + { + _calculator = new BasicCalc(); + } + + + [Fact] + public void IsPrime_ShouldReturnTrueIfPrime() + { + bool calc = _calculator.IsPrime(5); + Assert.Equal(true, calc); + } + + [Fact] + public void IsPrime_ShouldThrowException() + { + Assert.Throws(() => _calculator.IsPrime(-2)); + } + + + [Theory] + [InlineData(5, true)] + [InlineData(6, false)] + [InlineData(1, false)] + + public void IsPrime_Theory(int a, bool expectedResult) + { + bool calc = _calculator.IsPrime(a); + Assert.Equal(expectedResult, calc); + } + + } +}