public void TryGetLength_OnStreamWithoutKnownLength_ReturnsLength() { using (var memoryStream = new MemoryStream()) using (var stream = new GZipStream(memoryStream, CompressionMode.Compress)) { Assert.AreEqual(-1, stream.TryGetLength(), "TryGetLength should return -1 if the length cannot be determined"); } }