-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task33Tests.cs
32 lines (30 loc) · 892 Bytes
/
Task33Tests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using adventofcode_2021.Task33;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Xunit;
namespace adventofcode_2021.Tests
{
public class Task33Tests
{
[Fact]
public void Task33_RealExample_Correct()
{
var result = ReadFileAsync(Path.Combine("Task33", "Data.txt"));
Assert.Equal(7626, Solution.Function(result[0], result[1]));
}
private List<(int, int)> ReadFileAsync(string file)
{
return File.ReadLines(file)
.ElementAt(0)
.Split("target area: ")[1]
.Split(", ")
.Select(x =>
{
var data = new string(x.Skip(2).ToArray()).Split("..");
return (int.Parse(data[0]), int.Parse(data[1]));
})
.ToList();
}
}
}