public void SaveStatusFileTest()
        {
            string   profileName = "site";
            DateTime startTime   = DateTime.Now;
            DateTime endTime     = DateTime.Now.AddHours(1);

            StatusFileTestData[] tests = new StatusFileTestData[]
            {
                new StatusFileTestData()
                {
                    State             = DeployState.Succeeded,
                    ObjectsAdded      = 10,
                    ObjectsUpdated    = 20,
                    ObjectsDeleted    = 30,
                    ParametersChanged = 40,
                    BytesCopied       = 50,
                    StartTime         = DateTime.UtcNow,
                    EndTime           = DateTime.UtcNow.AddHours(1),
                    Complete          = true
                }
            };

            System.IO.Abstractions.FileBase MockFile = FileHelper.FileSystem.File;

            for (int i = 0; i < tests.Length; i++)
            {
                StatusFile statusFile = new StatusFile(profileName);
                statusFile.State             = tests[i].State;
                statusFile.ObjectsAdded      = tests[i].ObjectsAdded;
                statusFile.ObjectsUpdated    = tests[i].ObjectsUpdated;
                statusFile.ObjectsDeleted    = tests[i].ObjectsDeleted;
                statusFile.ParametersChanged = tests[i].ParametersChanged;
                statusFile.BytesCopied       = tests[i].BytesCopied;
                statusFile.StartTime         = tests[i].StartTime;
                statusFile.EndTime           = tests[i].EndTime;
                statusFile.Complete          = tests[i].Complete;

                statusFile.Save();

                Assert.IsTrue(MockFile.Exists(@"c:\" + profileName + @"\status.xml"));

                statusFile = new StatusFile(profileName);
                statusFile.LoadOrCreate();

                VerifyStatusFile(tests[i], statusFile);
            }
        }
        public void SaveConfigTest()
        {
            var tests = new[] {
                new List <SkipRule>(),
                new List <SkipRule>()
                {
                    new SkipRule()
                    {
                        Expression = "skip1"
                    }
                },
                new List <SkipRule>()
                {
                    new SkipRule()
                    {
                        Expression = "skip1", IsDirectory = true
                    },
                    new SkipRule()
                    {
                        Expression = "skip2", IsDirectory = false
                    }
                }
            };

            System.IO.Abstractions.FileBase MockFile = FileHelper.FileSystem.File;

            for (int i = 0; i < tests.Length; i++)
            {
                ConfigFile config = new ConfigFile();
                config.SetSkips(tests[i]);
                config.Save();

                Assert.IsTrue(MockFile.Exists(@"c:\config.xml"));

                config = new ConfigFile();
                config.LoadOrCreate();

                VerifySkipEnumerables(tests[i].AsEnumerable(), config.SkipRules);
            }
        }