Skip to content

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
And add some tests for RawMediaFrame
  • Loading branch information
ngraziano committed Apr 17, 2024
1 parent 0da1ead commit dbbe331
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions RTSP.Tests/Rtp/RawMediaFrameTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;

namespace Rtsp.Rtp.Tests
{
[TestFixture()]
public class RawMediaFrameTests
{
[Test()]
public void AnyTest()
{
List<ReadOnlyMemory<byte>> data = [
new byte[] {0x01 }.AsMemory(),
];
RawMediaFrame rawMediaFrame = new(data, []) { ClockTimestamp = DateTime.MinValue, RtpTimestamp = 0 };
Assert.That(rawMediaFrame.Any(), Is.True);
}

[Test()]
public void AnyEmptyTest()
{
RawMediaFrame rawMediaFrame = RawMediaFrame.Empty;
Assert.That(rawMediaFrame.Any(), Is.False);
}


[Test()]
public void AnyDisposedTest()
{
{
// Validate that Empty RawMediaFrame do not throw ObjectDisposedException when used multiple times
using RawMediaFrame rawMediaFrame = RawMediaFrame.Empty;
Assert.That(rawMediaFrame.Any(), Is.False);
}
{
using RawMediaFrame rawMediaFrame = RawMediaFrame.Empty;
Assert.That(rawMediaFrame.Any(), Is.False);
}

}
}
}
2 changes: 1 addition & 1 deletion RTSP/RTSP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>ngraziano</Authors>
<Product>SharpRTSP</Product>
<Description>Handle receive and send of Rtsp Messages</Description>
<VersionPrefix>1.4.1</VersionPrefix>
<VersionPrefix>1.4.2</VersionPrefix>
<PackageProjectUrl>https://github.com/ngraziano/SharpRTSP</PackageProjectUrl>
<RepositoryUrl>https://github.com/ngraziano/SharpRTSP</RepositoryUrl>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
Expand Down

0 comments on commit dbbe331

Please sign in to comment.