/
merdan
/
controlWorks_tests
Обзор
Документация
Войти
/
merdan
/
controlWorks_tests
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
ControlWork.Tests/TestForTask_1(MinimalValue).cs
58 строк
1 KB
merdan
I wrote the tests
15 ноя 2025, 04:36
15 ноя 2025, 04:36
7047a79
Код
Авторство
О чём код?
using System; using NUnit.Framework; using Methods; namespace ControlWorkTests; public class TestForTask1 { // 6 Tests [Test] public void CheckForNull() { int[] nums = null; Assert.Throws<ArgumentNullException>(() => MinimalValue.Find(nums)); } [Test] public void CheckForAnEmptyArray() { int[] nums = new int[0]; Assert.Throws<ArgumentException>(() => MinimalValue.Find(nums)); } [Test] public void Positive() { int result = MinimalValue.Find([5,4,7,18,9]); Assert.AreEqual(4, result); Assert.Pass(); } [Test] public void Same() { int result = MinimalValue.Find([4,4,4,4]); Assert.AreEqual(4, result); Assert.Pass(); } [Test] public void Negative() { int result = MinimalValue.Find([-1,-35,-4,-5]); Assert.AreEqual(-35, result); } [Test] public void PositiveNegative() { int result = MinimalValue.Find([ 1,15,-4,100,-1]); Assert.AreEqual(-4, result); } }