// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Xunit.Abstractions; namespace Microsoft.AspNetCore.Server.IntegrationTesting { public class TestVariant : IXunitSerializable { public ServerType Server { get; set; } public string Tfm { get; set; } public ApplicationType ApplicationType { get; set; } public RuntimeArchitecture Architecture { get; set; } public string Skip { get; set; } // ANCM specifics... public HostingModel HostingModel { get; set; } public AncmVersion AncmVersion { get; set; } public override string ToString() { // For debug and test explorer view var description = $"Server: {Server}, TFM: {Tfm}, Type: {ApplicationType}, Arch: {Architecture}"; if (Server == ServerType.IISExpress || Server == ServerType.IIS) { var version = AncmVersion == AncmVersion.AspNetCoreModule ? "V1" : "V2"; description += $", ANCM: {version}, Host: {HostingModel}"; } return description; } public void Serialize(IXunitSerializationInfo info) { info.AddValue(nameof(Skip), Skip, typeof(string)); info.AddValue(nameof(Server), Server, typeof(ServerType)); info.AddValue(nameof(Tfm), Tfm, typeof(string)); info.AddValue(nameof(ApplicationType), ApplicationType, typeof(ApplicationType)); info.AddValue(nameof(Architecture), Architecture, typeof(RuntimeArchitecture)); info.AddValue(nameof(HostingModel), HostingModel, typeof(HostingModel)); info.AddValue(nameof(AncmVersion), AncmVersion, typeof(AncmVersion)); } public void Deserialize(IXunitSerializationInfo info) { Skip = info.GetValue(nameof(Skip)); Server = info.GetValue(nameof(Server)); Tfm = info.GetValue(nameof(Tfm)); ApplicationType = info.GetValue(nameof(ApplicationType)); Architecture = info.GetValue(nameof(Architecture)); HostingModel = info.GetValue(nameof(HostingModel)); AncmVersion = info.GetValue(nameof(AncmVersion)); } } }