Created
December 8, 2017 13:19
-
-
Save smudge202/48e49f1354a59412941f796a5ffe4ad8 to your computer and use it in GitHub Desktop.
Test shenanigans
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Logs from Resharper EAP 9: