e81c127514
- Add JSON-based config loading with XML fallback for DB and library options - Implement LibraryOptionsRepository with EF Core, migrations, and entity - Update CollectionFolder to use DB-backed options with XML fallback/backfill - Register repository in DI and initialize at startup - Use EF execution strategy for transactional DB operations - Suppress code analysis warnings in .csproj and test files - Add DATABASE_MIGRATION.md, LIBRARY_OPTIONS_DB_DESIGN.md, and WEBSOCKET_AUTHENTICATION.md - Add database.json.example and improve migration docs - Add tests for JSON config loader and update test naming warnings
30 lines
988 B
C#
30 lines
988 B
C#
// <copyright file="FormattingStreamWriterTests.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Jellyfin.Extensions.Tests;
|
|
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using Xunit;
|
|
|
|
public static class FormattingStreamWriterTests
|
|
{
|
|
#pragma warning disable CA1707 // Identifiers should not contain underscores - xUnit test naming convention
|
|
#pragma warning disable IDE0063 // Use simple using statement
|
|
[Fact]
|
|
public static void Shuffle_Valid_Correct()
|
|
#pragma warning restore CA1707
|
|
#pragma warning restore IDE0063
|
|
{
|
|
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()));
|
|
}
|
|
}
|