|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Xunit.Threading
{
using System;
using System.ComponentModel;
using Xunit.Abstractions;
using Xunit.Harness;
using Xunit.Sdk;
public sealed class IdeSkippedDataRowTestCase : XunitSkippedDataRowTestCase
{
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Called by the deserializer; should only be called by deriving classes for deserialization purposes", error: true)]
public IdeSkippedDataRowTestCase()
{
}
public IdeSkippedDataRowTestCase(IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, TestMethodDisplayOptions defaultMethodDisplayOptions, ITestMethod testMethod, VisualStudioInstanceKey visualStudioInstanceKey, string skipReason, object?[]? testMethodArguments = null)
: base(diagnosticMessageSink, defaultMethodDisplay, defaultMethodDisplayOptions, testMethod, skipReason, testMethodArguments)
{
VisualStudioInstanceKey = visualStudioInstanceKey;
}
public VisualStudioInstanceKey VisualStudioInstanceKey
{
get;
private set;
}
protected override string GetDisplayName(IAttributeInfo factAttribute, string displayName)
{
var baseName = base.GetDisplayName(factAttribute, displayName);
return $"{baseName} ({VisualStudioInstanceKey.Version})";
}
protected override string GetUniqueID()
{
return $"{base.GetUniqueID()}_{VisualStudioInstanceKey.Version}";
}
public override void Serialize(IXunitSerializationInfo data)
{
if (data is null)
{
throw new ArgumentNullException(nameof(data));
}
base.Serialize(data);
data.AddValue(nameof(VisualStudioInstanceKey), VisualStudioInstanceKey.SerializeToString());
}
public override void Deserialize(IXunitSerializationInfo data)
{
if (data is null)
{
throw new ArgumentNullException(nameof(data));
}
VisualStudioInstanceKey = VisualStudioInstanceKey.DeserializeFromString(data.GetValue<string>(nameof(VisualStudioInstanceKey)));
base.Deserialize(data);
}
}
}
|