Christmas 2008

For easier reference, here are the 2008 advent calendar links: Why and advent calendar? What problem? Final thoughts. How: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

1

The 2008 Advent Calendar wrap up

Writing all these tests I sometimes felt that the changes between two days was not significant. And sometimes I felt there were versions that did not make it into this advent calendar. But I stuck with the versions you have seen since I think they represent a quite natural evolution of the initial test and…

3

2008 Advent Calendar December 24th

1: namespace Advent24 2: { 3: public class FileUtil_Tests 4: { 5: public FileUtilWithDelete Given_A_Readable_File(string content) 6: { 7: FileUtilWithDelete file = new FileUtilWithDelete(“SomeFile.txt”); 8: file.Create(content); 9: return file; 10: } 11: } 12:   13: public class FileUtil_Tests_With_Readable_File : FileUtil_Tests 14: { 15: [Fact] 16: public void Reading_A_Readable_File_Returns_File_Content() 17: { 18: using (FileUtilWithDelete file…

0

2008 Advent Calendar December 23rd

1: namespace Advent23 2: { 3: public class FileUtil_Tests_With_Readable_File 4: { 5: private FileUtilWithDelete Given_A_Readable_File(string content) 6: { 7: FileUtilWithDelete file = new FileUtilWithDelete(“SomeFile.txt”); 8: file.Create(content); 9: return file; 10: } 11:   12: [Fact] 13: public void Reading_A_Readable_File_Returns_File_Content() 14: { 15: using (FileUtilWithDelete file = Given_A_Readable_File(“CONTENT”)) 16: { 17: string content = file.Read(); 18:…

0

2008 Advent Calendar December 22nd

1: namespace Advent22 2: { 3: public class FileUtil_Specification 4: { 5: private FileUtilWithDelete Given_A_Readable_File(string content) 6: { 7: FileUtilWithDelete file = new FileUtilWithDelete(“SomeFile.txt”); 8: file.Create(content); 9: return file; 10: } 11:   12: private FileUtilWithDelete Given_An_Unreadable_File() 13: { 14: FileUtilWithDelete file = Given_A_Readable_File(“SHOULD NOT BE ABLE TO READ THIS”); 15: file.Readable = false; 16:…

0

2008 Advent Calendar December 21st

1: public class Advent21 2: { 3: private FileUtilWithDelete Given_A_Readable_File(string content) 4: { 5: FileUtilWithDelete file = new FileUtilWithDelete(“SomeFile.txt”); 6: file.Create(content); 7: return file; 8: } 9:   10: private FileUtilWithDelete Given_An_Unreadable_File() 11: { 12: FileUtilWithDelete file = Given_A_Readable_File(“SHOULD NOT BE ABLE TO READ THIS”); 13: file.Readable = false; 14: return file; 15: } 16:…

0

2008 Advent Calendar December 20th

1: public class Advent20 2: { 3: private FileUtilWithDelete Given_A_File(string content, bool readable) 4: { 5: FileUtilWithDelete file = new FileUtilWithDelete(“SomeFile.txt”); 6: file.Create(content); 7: file.Readable = readable; 8: return file; 9: } 10:   11: [Fact] 12: public void Reading_A_Readable_File_Returns_File_Content() 13: { 14: using (FileUtilWithDelete file = Given_A_File(“CONTENT”, true)) 15: { 16: string content =…

0

2008 Advent Calendar December 19th

1: public class Advent19 2: { 3: private FileUtilWithDelete SetUp(string content, bool readable) 4: { 5: FileUtilWithDelete file = new FileUtilWithDelete(“SomeFile.txt”); 6: file.Create(content); 7: file.Readable = readable; 8: return file; 9: } 10:   11: [Fact] 12: public void Reading_A_Readable_File_Returns_File_Content() 13: { 14: using (FileUtilWithDelete file = SetUp(“CONTENT”, true)) 15: { 16: string content =…

0

2008 Advent Calendar December 18th

1: public class Advent18 2: { 3: private FileUtilWithDelete SetUp(string content, bool readable) 4: { 5: FileUtilWithDelete file = new FileUtilWithDelete(“SomeFile.txt”); 6: file.Create(content); 7: file.Readable = readable; 8: return file; 9: } 10:   11: [Fact] 12: public void ReadingAReadableFileReturnsFileContent() 13: { 14: using (FileUtilWithDelete file = SetUp(“CONTENT”, true)) 15: { 16: string content =…

1

2008 Advent Calendar December 17th

1: public class Advent17 2: { 3: private FileUtilWithDelete SetUp(string content, bool readable) 4: { 5: FileUtilWithDelete file = new FileUtilWithDelete(“SomeFile.txt”); 6: file.Create(content); 7: file.Readable = readable; 8: return file; 9: } 10:   11: [Fact] 12: public void TestReadReadableFileReturnsFileContent() 13: { 14: using (FileUtilWithDelete file = SetUp(“CONTENT”, true)) 15: { 16: string content =…

2