зеркало из https://github.com/microsoft/testfx.git
Revert "Fix test case id filtering for server mode (#3284)"
This reverts commit 6d7777b082
.
This commit is contained in:
Родитель
de48b8275e
Коммит
f3cbc7bcf6
|
@ -25,7 +25,6 @@ internal class TestMethodFilter
|
|||
[Constants.PriorityProperty.Label] = Constants.PriorityProperty,
|
||||
[TestCaseProperties.FullyQualifiedName.Label] = TestCaseProperties.FullyQualifiedName,
|
||||
[TestCaseProperties.DisplayName.Label] = TestCaseProperties.DisplayName,
|
||||
[TestCaseProperties.Id.Label] = TestCaseProperties.Id,
|
||||
[Constants.TestClassNameProperty.Label] = Constants.TestClassNameProperty,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ namespace Microsoft.Testing.Extensions.VSTestBridge.ObjectModel;
|
|||
/// </summary>
|
||||
internal static class ObjectModelConverters
|
||||
{
|
||||
public static readonly TestProperty TestNodeUidProperty = TestProperty.Register(
|
||||
VSTestTestNodeProperties.TestNode.UidPropertyName,
|
||||
VSTestTestNodeProperties.TestNode.UidPropertyName, typeof(string), typeof(TestNode));
|
||||
|
||||
private static readonly TestProperty OriginalExecutorUriProperty = TestProperty.Register(
|
||||
VSTestTestNodeProperties.OriginalExecutorUriPropertyName, VSTestTestNodeProperties.OriginalExecutorUriPropertyName,
|
||||
typeof(Uri), typeof(TestNode));
|
||||
|
@ -25,7 +29,8 @@ internal static class ObjectModelConverters
|
|||
/// </summary>
|
||||
public static TestNode ToTestNode(this TestCase testCase, bool isTrxEnabled, ClientInfo client)
|
||||
{
|
||||
string testNodeUid = testCase.Id.ToString();
|
||||
string testNodeUid = testCase.GetPropertyValue<string>(TestNodeUidProperty, null)
|
||||
?? testCase.FullyQualifiedName;
|
||||
|
||||
TestNode testNode = new()
|
||||
{
|
||||
|
|
|
@ -5,7 +5,6 @@ using System.Diagnostics;
|
|||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
|
||||
using Microsoft.Testing.Extensions.VSTestBridge.Resources;
|
||||
using Microsoft.Testing.Platform;
|
||||
using Microsoft.Testing.Platform.CommandLine;
|
||||
using Microsoft.Testing.Platform.Extensions.Messages;
|
||||
|
@ -32,7 +31,8 @@ internal sealed class RunContextAdapter : ContextAdapterBase, IRunContext
|
|||
public RunContextAdapter(ICommandLineOptions commandLineOptions, IRunSettings runSettings, TestNodeUid[] testNodeUids)
|
||||
: this(commandLineOptions, runSettings)
|
||||
{
|
||||
FilterExpressionWrapper = new(CreateFilter(testNodeUids));
|
||||
// We assume that the UIDs we receive are TestCase.FullyQualifiedName values.
|
||||
FilterExpressionWrapper = new(string.Join("|", testNodeUids.Select(ConvertToFullyQualifiedNameFilterString)));
|
||||
}
|
||||
|
||||
// NOTE: Always false as it's TPv2 oriented and so not applicable to TA.
|
||||
|
@ -62,29 +62,38 @@ internal sealed class RunContextAdapter : ContextAdapterBase, IRunContext
|
|||
/// <inheritdoc />
|
||||
public IRunSettings? RunSettings { get; }
|
||||
|
||||
// We expect only GUID values in the testNodeUids.
|
||||
private static string CreateFilter(TestNodeUid[] testNodesUid)
|
||||
private static string ConvertToFullyQualifiedNameFilterString(TestNodeUid testNodeUid)
|
||||
{
|
||||
StringBuilder filter = new();
|
||||
StringBuilder filterString = new("FullyQualifiedName=");
|
||||
|
||||
for (int i = 0; i < testNodesUid.Length; i++)
|
||||
for (int i = 0; i < testNodeUid.Value.Length; i++)
|
||||
{
|
||||
if (Guid.TryParse(testNodesUid[i].Value, out Guid guid))
|
||||
char currentChar = testNodeUid.Value[i];
|
||||
switch (currentChar)
|
||||
{
|
||||
filter.Append("Id=");
|
||||
filter.Append(guid.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException(ExtensionResources.InvalidFilterValue);
|
||||
}
|
||||
case '\\':
|
||||
case '(':
|
||||
case ')':
|
||||
case '&':
|
||||
case '|':
|
||||
case '=':
|
||||
case '!':
|
||||
case '~':
|
||||
// If the symbol is not escaped, add an escape character.
|
||||
if (i - 1 < 0 || testNodeUid.Value[i - 1] != '\\')
|
||||
{
|
||||
filterString.Append('\\');
|
||||
}
|
||||
|
||||
if (i != testNodesUid.Length - 1)
|
||||
{
|
||||
filter.Append('|');
|
||||
filterString.Append(currentChar);
|
||||
break;
|
||||
|
||||
default:
|
||||
filterString.Append(currentChar);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return filter.ToString();
|
||||
return filterString.ToString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,15 +60,6 @@ namespace Microsoft.Testing.Extensions.VSTestBridge.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210.
|
||||
/// </summary>
|
||||
internal static string InvalidFilterValue {
|
||||
get {
|
||||
return ResourceManager.GetString("InvalidFilterValue", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to runsettings file '{0}' cannot be read.
|
||||
/// </summary>
|
||||
|
|
|
@ -138,7 +138,4 @@
|
|||
<data name="TestRunParameterOptionArgumentIsNotParameter" xml:space="preserve">
|
||||
<value>argument '{0}' is not a parameter. Parameters arguments are matching the following pattern 'key=value'.</value>
|
||||
</data>
|
||||
<data name="InvalidFilterValue" xml:space="preserve">
|
||||
<value>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</value>
|
||||
</data>
|
||||
</root>
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="cs" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">Relativní nebo absolutní cesta k souboru .runsettings. Další informace a příklady konfigurace testovacího běhu najdete v tématu https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="de" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">Der relative oder absolute Pfad zur Datei „.runsettings“. Weitere Informationen und Beispiele zum Konfigurieren des Testlaufs finden Sie unter https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="es" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">Ruta de acceso, relativa o absoluta, al archivo .runsettings. Para obtener más información y ejemplos sobre cómo configurar la serie de pruebas, consulte https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="fr" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">Chemin d’accès, relatif ou absolu, au fichier .runsettings. Pour plus d’informations et d’exemples sur la configuration de la série de tests, consultez https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="it" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">Percorso, relativo o assoluto, del file con estensione runsettings. Per altre informazioni ed esempi su come configurare l'esecuzione dei test, vedere https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="ja" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">.runsettings ファイルへの相対パスまたは絶対パス。テストの実行を構成する方法の詳細と例については、https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file を参照してください</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="ko" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">.runsettings 파일에 대한 상대 또는 절대 경로입니다. 테스트 실행을 구성하는 방법에 관한 자세한 내용 및 예시는 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file을 참조하세요.</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="pl" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">Ścieżka względna lub bezwzględna pliku .runsettings. Aby uzyskać więcej informacji i przykładów dotyczących konfigurowania przebiegu testu, zobacz: https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="pt-BR" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">O caminho, relativo ou absoluto, para o arquivo .runsettings. Para obter mais informações e exemplos sobre como configurar a execução de teste, consulte https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="ru" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">Относительный или абсолютный путь к файлу .runsettings. Дополнительные сведения и примеры настройки тестового запуска см. на странице https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="tr" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">.runsettings dosyasının göreli veya mutlak yolu. Test çalıştırmasını yapılandırma hakkında daha fazla bilgi ve örnek için şu sayfaya bakın: https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">.runsettings 文件的相对路径或绝对路径。有关如何配置测试运行的详细信息和示例,请参阅 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
|
||||
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../ExtensionResources.resx">
|
||||
<body>
|
||||
<trans-unit id="InvalidFilterValue">
|
||||
<source>Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</source>
|
||||
<target state="new">Current implementation supports only GUID Id, i.e. Id=8b0475fc-ff66-43fb-a8ba-f6def1f78210</target>
|
||||
<note />
|
||||
</trans-unit>
|
||||
<trans-unit id="RunSettingsOptionDescription">
|
||||
<source>The path, relative or absolute, to the .runsettings file. For more information and examples on how to configure test run, see https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</source>
|
||||
<target state="translated">.runsettings 檔案的相對或絕對路徑。如需如何設定測試回合的詳細資訊和範例,請參閱 https://learn.microsoft.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#the-runsettings-file</target>
|
||||
|
|
|
@ -20,6 +20,23 @@ public sealed class ObjectModelConvertersTests : TestBase
|
|||
{
|
||||
}
|
||||
|
||||
public void ToTestNode_WhenTestCaseHasTestNodeUidProperty_TestNodeUidUsesIt()
|
||||
{
|
||||
TestCase testCase = new("SomeFqn", new("executor://uri", UriKind.Absolute), "source.cs");
|
||||
testCase.SetPropertyValue(ObjectModelConverters.TestNodeUidProperty, "SomeUid");
|
||||
var testNode = testCase.ToTestNode(false, TestClient);
|
||||
|
||||
Assert.AreEqual("SomeUid", testNode.Uid.Value);
|
||||
}
|
||||
|
||||
public void ToTestNode_WhenTestCaseHasNoTestNodeUidProperty_TestNodeUidUsesFqn()
|
||||
{
|
||||
TestCase testCase = new("SomeFqn", new("executor://uri", UriKind.Absolute), "source.cs");
|
||||
var testNode = testCase.ToTestNode(false, TestClient);
|
||||
|
||||
Assert.AreEqual("SomeFqn", testNode.Uid.Value);
|
||||
}
|
||||
|
||||
public void ToTestNode_WhenTestCaseHasDisplayName_TestNodeDisplayNameUsesIt()
|
||||
{
|
||||
TestCase testCase = new("SomeFqn", new("executor://uri", UriKind.Absolute), "source.cs")
|
||||
|
@ -49,6 +66,15 @@ public sealed class ObjectModelConvertersTests : TestBase
|
|||
Assert.AreEqual("FilePath", testNode.Properties.Single<TestFileLocationProperty>().FilePath);
|
||||
}
|
||||
|
||||
public void ToTestNode_WhenTestResultHasTestNodeUidProperty_TestNodeUidUsesIt()
|
||||
{
|
||||
TestResult testResult = new(new TestCase("SomeFqn", new("executor://uri", UriKind.Absolute), "source.cs"));
|
||||
testResult.TestCase.SetPropertyValue(ObjectModelConverters.TestNodeUidProperty, "SomeUid");
|
||||
var testNode = testResult.ToTestNode(false, TestClient);
|
||||
|
||||
Assert.AreEqual("SomeUid", testNode.Uid.Value);
|
||||
}
|
||||
|
||||
public void ToTestNode_WhenTestResultOutcomeIsFailed_TestNodePropertiesContainFailedTestNodeStateProperty()
|
||||
{
|
||||
TestResult testResult = new(new TestCase("SomeFqn", new("executor://uri", UriKind.Absolute), "source.cs"))
|
||||
|
|
Загрузка…
Ссылка в новой задаче