-
Notifications
You must be signed in to change notification settings - Fork 315
/
RunSettingsTests.cs
39 lines (33 loc) · 1.09 KB
/
RunSettingsTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Xml;
using System.Xml.Serialization;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.TestPlatform.ObjectModel.UnitTests;
[TestClass]
public class RunSettingsTests
{
[TestMethod]
public void RunSettingsNameSerialization()
{
var chilRunSettings = new ChildRunSettings();
var xml = chilRunSettings.ToXml();
Assert.IsNotNull(xml);
}
public class ChildRunSettings : TestRunSettings
{
public ChildRunSettings() : base("SomeName")
{
}
public override XmlElement? ToXml()
{
var document = new XmlDocument();
using (XmlWriter writer = document.CreateNavigator()!.AppendChild())
{
new XmlSerializer(typeof(ChildRunSettings)).Serialize(writer, this);
}
return document.DocumentElement;
}
}
}