forked from adamfisher/RomanNumeral
-
Notifications
You must be signed in to change notification settings - Fork 1
/
TestUtils.cs
29 lines (26 loc) · 843 Bytes
/
TestUtils.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
using System;
using System.Collections.Generic;
using System.IO;
namespace RomanNumerals.Tests
{
public static class TestUtils
{
/// <summary>
/// Loads the test data.
/// </summary>
/// <returns>A dictionary of int to roman numeral mappings.</returns>
public static IDictionary<int, string> GetTestData()
{
var dictionary = new Dictionary<int, string>(4100);
var lines = File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestValues.txt"));
foreach (var line in lines)
{
var item = line.Split('=');
var number = int.Parse(item[0]);
var numeral = item[1];
dictionary[number] = numeral;
}
return dictionary;
}
}
}