:
ITMData ?
, , .
?
, . , unit test, - . :
public void Check_All_Properties_Parsed_Correctly(){.....}
public void Exception_Thrown_If_Lines_Is_Null(){.....}
public void Exception_Thrown_If_Lines_Is_Wrong_Length(){.....}
, , , "" . , , , , . ! MSDN.
, , , . Test Driven Development, TDD, . , Kent Beck Test Driven Development By Example, - Microsoft.NET. .
EDIT:
?
-, . , :
, .
? , 2 , :
- .
CheckPropertyX, CheckPropertyY .. , , . , , . 2: - , . , , , . , , , Assert, , . :
Assert.AreEqual("test1", myObject.PropertyX, "Property X was incorrectly parsed");
Assert.AreEqual("test2", myObject.PropertyY, "Property Y was incorrectly parsed");
When one of them does not work, you will find out which line failed. When you correct the corresponding error and re-run your tests, you will see if any other properties have worked. This is usually the approach that most people take because creating a class or even a method for each property leads to too much code and too much work to update.
source
share