Skip to content

Commit

Permalink
Run tests on .NET Framework as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Aug 5, 2023
1 parent e2a3cc4 commit fed964f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions YoutubeExplode.Tests/StreamSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public async Task I_can_get_a_specific_stream_from_a_video(string videoId)

foreach (var streamInfo in manifest.Streams)
{
await using var stream = await youtube.Videos.Streams.GetAsync(streamInfo);
using var stream = await youtube.Videos.Streams.GetAsync(streamInfo);
var bytesRead = await stream.ReadAsync(buffer.Memory);

// Assert
Expand Down Expand Up @@ -219,14 +219,14 @@ public async Task I_can_download_the_highest_quality_stream_from_a_video()
public async Task I_can_seek_to_a_specific_position_on_a_stream_from_a_video()
{
// Arrange
await using var buffer = new MemoryStream();
using var buffer = new MemoryStream();
var youtube = new YoutubeClient();

// Act
var manifest = await youtube.Videos.Streams.GetManifestAsync(VideoIds.Normal);
var streamInfo = manifest.GetAudioStreams().OrderBy(s => s.Size).First();

await using var stream = await youtube.Videos.Streams.GetAsync(streamInfo);
using var stream = await youtube.Videos.Streams.GetAsync(streamInfo);
stream.Seek(1000, SeekOrigin.Begin);
await stream.CopyToAsync(buffer);

Expand Down
5 changes: 3 additions & 2 deletions YoutubeExplode.Tests/YoutubeExplode.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net48;net7.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="PolyShim" Version="1.5.0" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" PrivateAssets="all" />
<PackageReference Include="coverlet.collector" Version="6.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit fed964f

Please sign in to comment.