-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And add some tests for RawMediaFrame
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
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); | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains 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