/
iRumba
/
LeetCode
Обзор
Документация
Войти
/
iRumba
/
LeetCode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
TwoSum1.Tests/UnitTest1.cs
29 строк
644 B
iRumba
1 Solution
18 ноя 2025, 07:23
18 ноя 2025, 07:23
8d256c6
Код
Авторство
О чём код?
using FluentAssertions; using FluentAssertions.Collections; namespace TwoSum1.Tests; public class Tests { public static object[] Cases = new[] { new object[] { new[] { 2, 7, 11, 15 }, 9, new[] { 0, 1 } }, new object[] { new[] { 3, 2, 4 }, 6, new[] { 1, 2 } }, new object[] { new[] { 3, 3 }, 6, new[] { 0, 1 } } }; [SetUp] public void Setup() { } [TestCaseSource(nameof(Cases))] public void Test1(int[] nums, int target, int[] expected) { var sol = new Solution(); var res = sol.TwoSum(nums, target); res.Should().BeEquivalentTo(expected); } }