Exemplo n.º 1
0
        public static void FSHelperTest()
        {
            string dir = @"C:\Intel";
            string outdir = @"C:\users\yabahman\desktop\";
            Directory.SetCurrentDirectory(dir);

            //Setup
            const string longData = "asdjfahsdkjfhaksdjfhakjsdfhakjsdfhaskjdfhaskjdfhaksdjfhaskjdfhaskjdfhaskdjfhaskjdfhaskjdfhaskjdfhaskjdfhaskdjfhaskjfdh";
            const string shortData = "a";
            FileHelper.Touch("Shrunk.txt", longData);
            FileHelper.Touch("Grew.txt", shortData);
            FileHelper.Touch("Removed.txt");
            File.Delete("Added.txt");

            //Take snapshot 1
            FSHelper fs1 = new FSHelper(dir);
            fs1.WriteToFile(outdir + @"outfile1.txt");

            //Modify things
            FileHelper.Touch("Shrunk.txt", shortData);
            FileHelper.Touch("Grew.txt", longData);
            File.Delete("Removed.txt");
            FileHelper.Touch("Added.txt");

            //Take snapshot 2
            FSHelper fs2 = new FSHelper(dir);
            fs2.WriteToFile(outdir + @"outfile2.txt");

            //Compare data
            fs2.Diff(fs1);
        }
Exemplo n.º 2
0
        public static void FSHelperTest2()
        {
            //string dir = @"C:\Users\";
            string dir = @"C:\";
            string outdir = @"C:\users\yabahman\desktop\";
            Directory.SetCurrentDirectory(dir);

            //Take snapshot 1
            FSHelper fs1 = new FSHelper(dir);
            fs1.WriteToFile(outdir + @"outfile1.txt");

            //Take snapshot 2
            FSHelper fs2 = new FSHelper(dir);
            fs2.WriteToFile(outdir + @"outfile2.txt");

            //Compare data
            fs2.Diff(fs1);
        }