Skip to content

Commit

Permalink
Rename test constants
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Jul 2, 2024
1 parent 4cb10f1 commit bb70585
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions TwitchDownloaderCore.Tests/ToolTests/M3U8Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class M3U8Tests
[InlineData(true, "ru-RU")]
public void CorrectlyParsesTwitchM3U8OfTransportStreams(bool useStream, string culture)
{
const string ExampleM3U8Twitch =
const string EXAMPLE_M3U8_TWITCH =
"#EXTM3U" +
"\n#EXT-X-VERSION:3" +
"\n#EXT-X-TARGETDURATION:10" +
Expand All @@ -37,13 +37,13 @@ public void CorrectlyParsesTwitchM3U8OfTransportStreams(bool useStream, string c
M3U8 m3u8;
if (useStream)
{
var bytes = Encoding.Unicode.GetBytes(ExampleM3U8Twitch);
var bytes = Encoding.Unicode.GetBytes(EXAMPLE_M3U8_TWITCH);
using var ms = new MemoryStream(bytes);
m3u8 = M3U8.Parse(ms, Encoding.Unicode);
}
else
{
m3u8 = M3U8.Parse(ExampleM3U8Twitch);
m3u8 = M3U8.Parse(EXAMPLE_M3U8_TWITCH);
}

CultureInfo.CurrentCulture = oldCulture;
Expand Down Expand Up @@ -73,7 +73,7 @@ public void CorrectlyParsesTwitchM3U8OfTransportStreams(bool useStream, string c
[InlineData(true, "ru-RU")]
public void CorrectlyParsesTwitchM3U8OfLiveStreams(bool useStream, string culture)
{
const string ExampleM3U8Twitch =
const string EXAMPLE_M3U8_TWITCH =
"#EXTM3U" +
"\n#EXT-X-VERSION:3" +
"\n#EXT-X-TARGETDURATION:5" +
Expand Down Expand Up @@ -129,13 +129,13 @@ public void CorrectlyParsesTwitchM3U8OfLiveStreams(bool useStream, string cultur
M3U8 m3u8;
if (useStream)
{
var bytes = Encoding.Unicode.GetBytes(ExampleM3U8Twitch);
var bytes = Encoding.Unicode.GetBytes(EXAMPLE_M3U8_TWITCH);
using var ms = new MemoryStream(bytes);
m3u8 = M3U8.Parse(ms, Encoding.Unicode);
}
else
{
m3u8 = M3U8.Parse(ExampleM3U8Twitch);
m3u8 = M3U8.Parse(EXAMPLE_M3U8_TWITCH);
}

CultureInfo.CurrentCulture = oldCulture;
Expand Down Expand Up @@ -167,7 +167,7 @@ public void CorrectlyParsesTwitchM3U8OfLiveStreams(bool useStream, string cultur
[InlineData(true, "ru-RU")]
public void CorrectlyParsesTwitchM3U8OfPlaylists(bool useStream, string culture)
{
const string ExampleM3U8Twitch =
const string EXAMPLE_M3U8_TWITCH =
"#EXTM3U" +
"\n#EXT-X-TWITCH-INFO:ORIGIN=\"s3\",B=\"false\",REGION=\"NA\",USER-IP=\"255.255.255.255\",SERVING-ID=\"123abc456def789ghi012jkl345mno67\",CLUSTER=\"cloudfront_vod\",USER-COUNTRY=\"US\",MANIFEST-CLUSTER=\"cloudfront_vod\"" +
"\n#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID=\"chunked\",NAME=\"1080p60\",AUTOSELECT=NO,DEFAULT=NO" +
Expand Down Expand Up @@ -217,13 +217,13 @@ public void CorrectlyParsesTwitchM3U8OfPlaylists(bool useStream, string culture)
M3U8 m3u8;
if (useStream)
{
var bytes = Encoding.Unicode.GetBytes(ExampleM3U8Twitch);
var bytes = Encoding.Unicode.GetBytes(EXAMPLE_M3U8_TWITCH);
using var ms = new MemoryStream(bytes);
m3u8 = M3U8.Parse(ms, Encoding.Unicode);
}
else
{
m3u8 = M3U8.Parse(ExampleM3U8Twitch);
m3u8 = M3U8.Parse(EXAMPLE_M3U8_TWITCH);
}

CultureInfo.CurrentCulture = oldCulture;
Expand Down Expand Up @@ -280,7 +280,7 @@ public void CorrectlyParsesTwitchM3U8StreamInfo(string streamInfoString, int ban
[InlineData(true, "ru-RU")]
public void CorrectlyParsesKickM3U8OfTransportStreams(bool useStream, string culture)
{
const string ExampleM3U8Kick =
const string EXAMPLE_M3U8_KICK =
"#EXTM3U" +
"\n#EXT-X-VERSION:4" +
"\n#EXT-X-MEDIA-SEQUENCE:0" +
Expand Down Expand Up @@ -343,13 +343,13 @@ public void CorrectlyParsesKickM3U8OfTransportStreams(bool useStream, string cul
M3U8 m3u8;
if (useStream)
{
var bytes = Encoding.Unicode.GetBytes(ExampleM3U8Kick);
var bytes = Encoding.Unicode.GetBytes(EXAMPLE_M3U8_KICK);
using var ms = new MemoryStream(bytes);
m3u8 = M3U8.Parse(ms, Encoding.Unicode);
}
else
{
m3u8 = M3U8.Parse(ExampleM3U8Kick);
m3u8 = M3U8.Parse(EXAMPLE_M3U8_KICK);
}

CultureInfo.CurrentCulture = oldCulture;
Expand Down Expand Up @@ -378,7 +378,7 @@ public void CorrectlyParsesKickM3U8OfTransportStreams(bool useStream, string cul
[InlineData(true, "ru-RU")]
public void CorrectlyParsesKickM3U8OfPlaylists(bool useStream, string culture)
{
const string ExampleM3U8Kick =
const string EXAMPLE_M3U8_KICK =
"#EXTM3U" +
"\n#EXT-X-SESSION-DATA:DATA-ID=\"net.live-video.content.id\",VALUE=\"AbC123dEf456\"" +
"\n#EXT-X-SESSION-DATA:DATA-ID=\"net.live-video.customer.id\",VALUE=\"123456789012\"" +
Expand Down Expand Up @@ -423,13 +423,13 @@ public void CorrectlyParsesKickM3U8OfPlaylists(bool useStream, string culture)
M3U8 m3u8;
if (useStream)
{
var bytes = Encoding.Unicode.GetBytes(ExampleM3U8Kick);
var bytes = Encoding.Unicode.GetBytes(EXAMPLE_M3U8_KICK);
using var ms = new MemoryStream(bytes);
m3u8 = M3U8.Parse(ms, Encoding.Unicode);
}
else
{
m3u8 = M3U8.Parse(ExampleM3U8Kick);
m3u8 = M3U8.Parse(EXAMPLE_M3U8_KICK);
}

CultureInfo.CurrentCulture = oldCulture;
Expand Down

0 comments on commit bb70585

Please sign in to comment.