Пример #1
0
        public void ShouldFindSolutionForGivenSet()
        {
            var result = PerfectSumSolver.Solve(new HashSet <int>()
            {
                1, 5, 20, 50, 100
            }, 150);

            result.HasValue.ShouldBe(true);
            result.Contains((50, 100)).ShouldBe(true);
        }
Пример #2
0
        public void ShouldFindNoSolutionsWithEmptySet()
        {
            var result = PerfectSumSolver.Solve(new HashSet <int>(), 0);

            result.HasValue.ShouldBe(false);
        }
Пример #3
0
 public void ShouldThrowArgumentNullExceptionWhenGivenNullSet()
 {
     Should.Throw <ArgumentNullException>(() => PerfectSumSolver.Solve(null, 0));
 }