public void Serialize_CorrectDoubleLinkedList_Success() { using (var resultStream = new MemoryStream()) { linkedListSerializer.Serialize(linkedList, resultStream, leaveOpen: true); resultStream.ToArray().Should().Equal(GetExpectedStream().ToArray()); } }
public void DoubleLinkedList() { using (var memoryStream = new MemoryStream()) { var linkedList = DoubleLinkedListFactory.GetDoubleLinkedList(count: 10); linkedListSerializer.Serialize(linkedList, memoryStream, leaveOpen: true); memoryStream.Position = 0; var deserializedLinkedList = linkedListSerializer.Deserialize(memoryStream, leaveOpen: true); linkedList.Should().Equal(deserializedLinkedList, new DoubleLinkEqualityComparer().Equals); } }