Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# UnitTesting
# Danilov Bogacheva ispp35
1 change: 1 addition & 0 deletions UnitTesting/unV1RUS/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Данилов Богачева испп 35
46 changes: 46 additions & 0 deletions UnitTesting/unV1RUS/basic.cs
Original file line number Diff line number Diff line change
@@ -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<ArgumentOutOfRangeException>(() => _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);
}

}
}