- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
[TestFixture]
class Program
{
static void Main(string[] args)
{
.................
}
}
[TestFixture]
internal class FileParser
{
[Test]
private static string Replace(string inputValue, string oldWord,string newWord)
{
return inputValue.Replace(oldWord, newWord);
}
[Test]
private static string Remove(string inputValue, string word)
{
return inputValue.Replace(word, null);
}
[Test]
public string Run(string stringFromFile)
{
foreach (var command in _listOfCommands)
{
switch (command.IdCommand)
{
case 0:
stringFromFile = Replace(stringFromFile, command.OldWord, command.NewWord);
break;
case 1:
stringFromFile = Remove(stringFromFile, command.NewWord);
break;
}
}
return stringFromFile;
}
}
программист слишком буквально понял TestDrivenDevelopment :)) взято из консольного приложения
guest 19.12.2009 11:34 # 0
guest 19.12.2009 19:42 # 0
guest 22.12.2009 15:58 # 0
guest 22.12.2009 18:20 # 0
http://nunit.com/index.php?p=quickStart&r=2.5.3
guest 22.12.2009 19:23 # 0
guest 20.12.2009 13:01 # −3
zerkms 20.12.2009 18:26 # +1
guest 21.12.2009 03:06 # +1
guest 21.12.2009 12:18 # 0
guest 23.12.2009 14:56 # 0
guest 19.09.2011 23:45 # 0
guest 19.09.2011 23:51 # 0