public void AssertSection(string expectedSectionName, params string[] expectedProperties)
{
expectedProperties = expectedProperties ?? new string[0];
Dictionary<string, string> properties;
Assert.IsTrue(TestFile.TryGetSection(expectedSectionName, out properties),
string.Format("Unable to get section '{0}'", expectedSectionName));
Assert.IsTrue(expectedProperties.Length % 2 == 0,
"expectedProperties must have an even number of elements");
Assert.AreEqual(expectedProperties.Length / 2, properties.Count,
"The number of properties is incorrect");
for (int i = 0; i < expectedProperties.Length; i += 2)
{
Assert.IsTrue(properties.ContainsKey(expectedProperties[i]),
string.Format("The section properties doesn't contain the key '{0}'", expectedProperties[i]));
Assert.AreEqual(expectedProperties[i + 1], properties[expectedProperties[i]]);
}
}