Merge pull request #14 from wixtoolset/bob/SummaryInformation

Add _SummaryInformation support to Query.
This commit is contained in:
Bob Arnson 2020-10-22 19:37:44 -04:00 коммит произвёл GitHub
Родитель c0bdce5ec3 c98e207fda
Коммит f5758d825b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 31 добавлений и 3 удалений

Просмотреть файл

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
namespace WixBuildTools.TestSupport
{
@ -12,6 +12,13 @@ namespace WixBuildTools.TestSupport
private List<string> CleanupPaths { get; } = new List<string>();
public bool Keep { get; }
public DisposableFileSystem(bool keep = false)
{
this.Keep = keep;
}
protected string GetFile(bool create = false)
{
var path = Path.GetTempFileName();
@ -56,7 +63,7 @@ namespace WixBuildTools.TestSupport
return;
}
if (disposing)
if (disposing && !this.Keep)
{
foreach (var path in this.CleanupPaths)
{

Просмотреть файл

@ -44,6 +44,26 @@ namespace WixBuildTools.TestSupport
{
foreach (var table in tables)
{
if (table == "_SummaryInformation")
{
var entries = new List<string>();
results.Add(table, entries);
entries.Add($"Title\t{db.SummaryInfo.Title}");
entries.Add($"Subject\t{db.SummaryInfo.Subject}");
entries.Add($"Author\t{db.SummaryInfo.Author}");
entries.Add($"Keywords\t{db.SummaryInfo.Keywords}");
entries.Add($"Comments\t{db.SummaryInfo.Comments}");
entries.Add($"Template\t{db.SummaryInfo.Template}");
entries.Add($"CodePage\t{db.SummaryInfo.CodePage}");
entries.Add($"PageCount\t{db.SummaryInfo.PageCount}");
entries.Add($"WordCount\t{db.SummaryInfo.WordCount}");
entries.Add($"CharacterCount\t{db.SummaryInfo.CharacterCount}");
entries.Add($"Security\t{db.SummaryInfo.Security}");
continue;
}
if (!db.IsTablePersistent(table))
{
results.Add(table, null);
@ -52,6 +72,7 @@ namespace WixBuildTools.TestSupport
var rows = new List<string>();
results.Add(table, rows);
using (var view = db.OpenView("SELECT * FROM `{0}`", table))
{
view.Execute();

Просмотреть файл

@ -22,8 +22,8 @@ namespace WixBuildTools.TestSupport
public static void CompareXml(XContainer xExpected, XContainer xActual)
{
var actuals = xActual.Descendants().Select(x => $"{x.Name.LocalName}:{String.Join(",", x.Attributes().OrderBy(a => a.Name.LocalName).Select(a => $"{a.Name.LocalName}={a.Value}"))}");
var expecteds = xExpected.Descendants().Select(x => $"{x.Name.LocalName}:{String.Join(",", x.Attributes().OrderBy(a => a.Name.LocalName).Select(a => $"{a.Name.LocalName}={a.Value}"))}");
var actuals = xActual.Descendants().Select(x => $"{x.Name.LocalName}:{String.Join(",", x.Attributes().OrderBy(a => a.Name.LocalName).Select(a => $"{a.Name.LocalName}={a.Value}"))}");
CompareLineByLine(expecteds.OrderBy(s => s).ToArray(), actuals.OrderBy(s => s).ToArray());
}