Skip to content

Instantly share code, notes, and snippets.

@smudge202
Created December 8, 2017 13:19
Show Gist options
  • Save smudge202/48e49f1354a59412941f796a5ffe4ad8 to your computer and use it in GitHub Desktop.
Save smudge202/48e49f1354a59412941f796a5ffe4ad8 to your computer and use it in GitHub Desktop.
Test shenanigans
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
</Project>
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Xunit;
namespace TestDiffRepro.Tests
{
public class UnitTest1
{
[Theory, ClassData(typeof(TheoryRepro))]
public void Test1(HttpStatusCode statusCode)
{
Assert.True(true);
}
}
public class TheoryRepro : IEnumerable<object[]>
{
private static readonly IEnumerable<object[]> Data = Enum.GetValues(typeof(HttpStatusCode))
.Cast<HttpStatusCode>()
.Select(statusCode => new object[] { statusCode });
public IEnumerator<object[]> GetEnumerator() => Data.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => Data.GetEnumerator();
}
}
@smudge202
Copy link
Author

Pastebin of full log file for the EAP 9 test run: https://pastebin.com/EynMDkwa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment