mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Create and use FormattingStreamWriter Original-merge: cd2f2ca17800f71c8d94a6e043b49b7c4200e254 Merged-by: Bond-009 <bond.009@outlook.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
24 lines
632 B
C#
24 lines
632 B
C#
using System.Globalization;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using Xunit;
|
|
|
|
namespace Jellyfin.Extensions.Tests;
|
|
|
|
public static class FormattingStreamWriterTests
|
|
{
|
|
[Fact]
|
|
public static void Shuffle_Valid_Correct()
|
|
{
|
|
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE", false);
|
|
using (var ms = new MemoryStream())
|
|
using (var txt = new FormattingStreamWriter(ms, CultureInfo.InvariantCulture))
|
|
{
|
|
txt.Write("{0}", 3.14159);
|
|
txt.Close();
|
|
Assert.Equal("3.14159", Encoding.UTF8.GetString(ms.ToArray()));
|
|
}
|
|
}
|
|
}
|