/
merdan
/
controlWorks_tests
Обзор
Документация
Войти
/
merdan
/
controlWorks_tests
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
ControlWork.Tests/TestForTask_5(RunningSum).cs
38 строк
1 KB
merdan
I wrote the tests
15 ноя 2025, 04:36
15 ноя 2025, 04:36
7047a79
Код
Авторство
О чём код?
using Methods; namespace ControlWorkTests; [TestFixture] public class TestForTask5 { // 8 Tests [Test] public void ChekForNull() { int[] x = null; Assert.Throws<ArgumentNullException>(()=> RunningSum.Get(x)); } [Test] public void ChekForEmpty() { int [] x = new int[0]; Assert.Throws<ArgumentException>(()=> RunningSum.Get(x)); } [TestCase( new int[] {0, 0, 3, 17, 25, 27}, new int[] {0, 3, 14, 8, 2, 94})] [TestCase( new int[] {0, 1, 1, 4, 9, 34}, new int[] {1, 0, 3, 5, 25, 8})] [TestCase( new int[] {0, -8, -6, -3, -2, -2}, new int[] {-8, 2, 3, 1, 0, 27})] [TestCase( new int[] {0, 9, 9}, new int[] {9, 0, -1})] [TestCase( new int[] {0,1,3,6}, new int[] { 1, 2, 3, 6 })] [TestCase( new int[] {0}, new int[] {1})] [TestCase( new int[] {0,1}, new int[] {1,7})] [TestCase( new int[] {0 ,-1 ,-4 ,-9}, new int[] {-1, -3, -5, -6})] [Test] public void test1(int [] x, int [] y) { Assert.AreEqual( x, RunningSum.Get(y)); } }