Пример #1
0
        public void EnumerateAndReadDoesNotChangeEnumerationOrder()
        {
            string folderVirtualPath = this.Enlistment.GetVirtualPathTo("EnumerateAndReadTestFiles");

            NativeTests.EnumerateAndReadDoesNotChangeEnumerationOrder(folderVirtualPath).ShouldEqual(true);
            folderVirtualPath.ShouldBeADirectory(this.fileSystem);
            folderVirtualPath.ShouldBeADirectory(this.fileSystem).WithItems();
        }
Пример #2
0
        public void FolderPlaceHolderHasVersionInfo()
        {
            string virtualFilePath = this.Enlistment.GetVirtualPathTo("GVFlt_BugRegressionTest\\GVFlt_ModifyFileInScratchAndDir");

            ProcessResult revParseHeadResult = GitProcess.InvokeProcess(this.Enlistment.RepoRoot, "rev-parse HEAD");
            string        commitID           = revParseHeadResult.Output.Trim();

            NativeTests.PlaceHolderHasVersionInfo(virtualFilePath, CurrentPlaceholderVersion, string.Empty).ShouldEqual(true);
        }
Пример #3
0
        public void FilePlaceHolderHasVersionInfo()
        {
            string sha             = "BB1C8B9ADA90D6B8F6C88F12C6DDB07C186155BD";
            string virtualFilePath = this.Enlistment.GetVirtualPathTo("GVFlt_BugRegressionTest\\GVFlt_ModifyFileInScratchAndDir\\ModifyFileInScratchAndDir.txt");

            virtualFilePath.ShouldBeAFile(this.fileSystem).WithContents();

            ProcessResult revParseHeadResult = GitProcess.InvokeProcess(this.Enlistment.RepoRoot, "rev-parse HEAD");
            string        commitID           = revParseHeadResult.Output.Trim();

            NativeTests.PlaceHolderHasVersionInfo(virtualFilePath, CurrentPlaceholderVersion, sha).ShouldEqual(true);
        }
Пример #4
0
 private bool PlaceholderHasVersionInfo(string relativePath, int version, string sha)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         return(NativeTests.PlaceHolderHasVersionInfo(relativePath, version, sha));
     }
     else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
     {
         //// TODO(Mac): Add a version of PlaceHolderHasVersionInfo that works on Mac
         return(true);
     }
     else
     {
         Assert.Fail("Unsupported platform");
         return(false);
     }
 }
Пример #5
0
        private void EnumerateAndReadShouldNotChangeEnumerationOrder(string folderRelativePath)
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                NativeTests.EnumerateAndReadDoesNotChangeEnumerationOrder(folderRelativePath).ShouldEqual(true);
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                string[] entries = Directory.GetFileSystemEntries(folderRelativePath);
                foreach (string entry in entries)
                {
                    File.ReadAllText(entry);
                }

                string[] postReadEntries = Directory.GetFileSystemEntries(folderRelativePath);
                Enumerable.SequenceEqual(entries, postReadEntries)
                .ShouldBeTrue($"Entries are not the same after reading. Orignial list:\n{string.Join(",", entries)}\n\nAfter read:\n{string.Join(",", postReadEntries)}");
            }
            else
            {
                Assert.Fail("Unsupported platform");
            }
        }
 private bool PlaceholderHasVersionInfo(string relativePath, int version, string sha)
 {
     return(NativeTests.PlaceHolderHasVersionInfo(relativePath, version, sha));
 }
 private void EnumerateAndReadShouldNotChangeEnumerationOrder(string folderRelativePath)
 {
     NativeTests.EnumerateAndReadDoesNotChangeEnumerationOrder(folderRelativePath).ShouldEqual(true);
 }