System.IO.Tests.PathTests_Join.TryJoinThreePaths C# (CSharp) Méthode

TryJoinThreePaths() private méthode

private TryJoinThreePaths ( string path1, string path2, string path3, string expected ) : void
path1 string
path2 string
path3 string
expected string
Résultat void
        public void TryJoinThreePaths(string path1, string path2, string path3, string expected)
        {
            char[] output = new char[expected.Length];

            Assert.True(Path.TryJoin(path1, path2, path3, output, out int written));
            Assert.Equal(expected.Length, written);
            Assert.Equal(expected, new string(output));

            if (expected.Length > 0)
            {
                Assert.False(Path.TryJoin(path1, path2, path3, Span<char>.Empty, out written));
                Assert.Equal(0, written);

                output = new char[expected.Length - 1];
                Assert.False(Path.TryJoin(path1, path2, path3, output, out written));
                Assert.Equal(0, written);
                Assert.Equal(output, new char[output.Length]);
            }
        }