Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions test/ReverseProxy.Tests/Utilities/TlsFrameHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ public void SniHelper_InvalidData_Fails(int id, byte[] clientHello)
InvalidClientHello(clientHello, id, shouldPass: false);
}

[Theory]
[MemberData(nameof(InvalidClientHelloDataTruncatedBytes))]
public void SniHelper_TruncatedData_Fails(int id, byte[] clientHello)
[Fact]
public void SniHelper_TruncatedData_Fails()
{
InvalidClientHello(clientHello, id, shouldPass: false);
// moving inside one test because there are more than 3000 cases and they overflow subresults
foreach ((int id, byte[] clientHello) in InvalidClientHelloDataTruncatedBytes())
{
InvalidClientHello(clientHello, id, shouldPass: false);
}
}

private void InvalidClientHello(byte[] clientHello, int id, bool shouldPass)
Expand Down Expand Up @@ -129,7 +132,7 @@ public static IEnumerable<object[]> InvalidClientHelloData()
}
}

public static IEnumerable<object[]> InvalidClientHelloDataTruncatedBytes()
public static IEnumerable<Tuple<int, byte[]>> InvalidClientHelloDataTruncatedBytes()
{
// converting to base64 first to remove duplicated test cases
var uniqueInvalidHellos = new HashSet<string>();
Expand All @@ -150,7 +153,7 @@ public static IEnumerable<object[]> InvalidClientHelloDataTruncatedBytes()
foreach (string invalidClientHello in uniqueInvalidHellos)
{
id++;
yield return new object[] { id, Convert.FromBase64String(invalidClientHello) };
yield return new Tuple<int, byte[]>(id, Convert.FromBase64String(invalidClientHello));
}
}

Expand Down