Skip to content

Commit

Permalink
test: remove unit tests that uses obsolete binaryformatter
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmaeg committed Jul 3, 2024
1 parent 7086f16 commit 9a17ae1
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions OnvifDiscovery.Tests/Exceptions/DiscoveryExceptionTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Runtime.Serialization.Formatters.Binary;
using FluentAssertions;
using FluentAssertions;
using OnvifDiscovery.Exceptions;
using Xunit;

Expand Down Expand Up @@ -49,25 +48,4 @@ public void DiscriminatorNotAvailableException_ctor_string_ex()
sut.InnerException.Should().Be(innerEx);
sut.Message.Should().Be(expectedMessage);
}

[Fact]
public void DiscriminatorNotAvailableException_serialization_deserialization_test()
{
// Arrange
var innerEx = new Exception("foo");
var originalException = new DiscoveryException("message", innerEx);
var buffer = new byte[4096];
var ms = new MemoryStream(buffer);
var ms2 = new MemoryStream(buffer);
var formatter = new BinaryFormatter();

// Act
formatter.Serialize(ms, originalException);
var deserializedException = (DiscoveryException)formatter.Deserialize(ms2);

// Assert
deserializedException.Should().NotBeNull();
deserializedException.InnerException.Should().NotBeNull();
deserializedException.Message.Should().Be(originalException.Message);
}
}

0 comments on commit 9a17ae1

Please sign in to comment.