Esempio n. 1
0
        private void TestPathParts(GitIndexEntry indexEntry, string[] pathParts, bool hasSameParent)
        {
            if (this.buildingNewProjection)
            {
                indexEntry.BuildingProjection_HasSameParentAsLastEntry.ShouldEqual(hasSameParent, nameof(indexEntry.BuildingProjection_HasSameParentAsLastEntry));
                indexEntry.BuildingProjection_NumParts.ShouldEqual(pathParts.Length, nameof(indexEntry.BuildingProjection_NumParts));
            }

            for (int i = 0; i < pathParts.Length; i++)
            {
                if (this.buildingNewProjection)
                {
                    indexEntry.BuildingProjection_PathParts[i].ShouldNotBeNull();
                    indexEntry.BuildingProjection_PathParts[i].GetString().ShouldEqual(pathParts[i]);
                }
            }

            if (this.buildingNewProjection)
            {
                indexEntry.BuildingProjection_GetChildName().GetString().ShouldEqual(pathParts[pathParts.Length - 1]);
                indexEntry.BuildingProjection_GetGitRelativePath().ShouldEqual(string.Join("/", pathParts));
            }
            else
            {
                indexEntry.BackgroundTask_GetPlatformRelativePath().ShouldEqual(string.Join(Path.DirectorySeparatorChar.ToString(), pathParts));
            }
        }