public static void SaveResult(TestResult result, Test test, string folder)
        {
            result.Locator = test.GetPath().Locator;

            var fileSystem = new FileSystem();
            fileSystem.CreateDirectory(folder);

            var filename = Path.Combine(folder, FileNameFor(test));

            fileSystem.PersistToFile(result, filename);
        }
        public void SaveResultsToDirectory(ResultHistory theResults, string directory)
        {
            var system = new FileSystem();
            system.ClearFolder(directory);

            theResults.Each((path, result) =>
            {
                result.Locator = path;
                string filename = FileNameFor(path);
                filename = Path.Combine(directory, filename);
                system.PersistToFile(result, filename);
            });
        }
        public void SetUp()
        {
            packageFolder = FileSystem.Combine("../../../TestPackage1").ToFullPath();

            var fileSystem = new FileSystem();
            var manifest = new PackageManifest(){
                Assemblies = "TestPackage1",
                Name = "pak1"
            };

            fileSystem.PersistToFile(manifest, packageFolder, PackageManifest.FILE);

            reader = new PackageManifestReader("../../".ToFullPath(), fileSystem);
        }
        public void SetUp()
        {
            packageFolder = FileSystem.Combine("../../../TestPackage1").ToFullPath();

            var fileSystem = new FileSystem();
            var manifest = new PackageManifest{
                Name = "pak1"
            };

            manifest.AddAssembly("TestPackage1");

            fileSystem.PersistToFile(manifest, packageFolder, PackageManifest.FILE);

            linkedFolderReader = new LinkedFolderPackageLoader(theApplicationDirectory, f => f);

            reader = new BottleManifestReader(fileSystem, folder => folder);
        }
        public void save_and_load_an_object_to_xml()
        {
            var object1 = new BigObject
            {
                Name = "Max",
                Age = 5
            };
            var system = new FileSystem();
            system.PersistToFile(object1, "bigobject.xml");

            var object2 = system.LoadFromFile<BigObject>("bigobject.xml");

            object1.ShouldNotBeTheSameAs(object2);
            object1.ShouldEqual(object2);
        }