Enhance code readability and maintainability by refactoring various components. Update formatting commands in CLAUDE.md for csharpier integration. Simplify method signatures in SegmentFiles, UploadLimits, and multiple endpoint classes for improved clarity. Adjust query handlers and command handlers to streamline parameter handling and enhance consistency across the application.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using TeleWave.Domain.Broadcast.Scheduling;
|
||||
using GridPlanner = TeleWave.Domain.Programming.Planning.SchedulePlanner;
|
||||
using TeleWave.Domain.Programming;
|
||||
using TeleWave.Domain.Programming.Planning;
|
||||
using Xunit;
|
||||
using GridPlanner = TeleWave.Domain.Programming.Planning.SchedulePlanner;
|
||||
|
||||
namespace TeleWave.Domain.Tests.Programming;
|
||||
|
||||
@@ -43,9 +43,10 @@ public class GoldenScheduleTests
|
||||
.Items.OrderBy(i => i.StartsAtUtc)
|
||||
.Select(item =>
|
||||
{
|
||||
var label = item.ShowId is { } showId && names.TryGetValue(showId, out var name)
|
||||
? $"{name}#{item.UnitIndex}"
|
||||
: item.Kind.ToString();
|
||||
var label =
|
||||
item.ShowId is { } showId && names.TryGetValue(showId, out var name)
|
||||
? $"{name}#{item.UnitIndex}"
|
||||
: item.Kind.ToString();
|
||||
return string.Create(
|
||||
CultureInfo.InvariantCulture,
|
||||
$"{item.StartsAtUtc:HH:mm} {label}"
|
||||
@@ -60,10 +61,7 @@ public class GoldenScheduleTests
|
||||
.Range(0, episodes)
|
||||
.Select(i => new PlanningUnit(Guid.NewGuid(), TimeSpan.FromMinutes(minutes), showId, i))
|
||||
.ToList();
|
||||
return (
|
||||
new PlanningElement(GroupElementKind.Show, Guid.NewGuid(), 1, 0, units),
|
||||
showId
|
||||
);
|
||||
return (new PlanningElement(GroupElementKind.Show, Guid.NewGuid(), 1, 0, units), showId);
|
||||
}
|
||||
|
||||
private static PlanningSlot ContentSlot(
|
||||
@@ -129,12 +127,7 @@ public class GoldenScheduleTests
|
||||
.ToList();
|
||||
|
||||
Assert.Equal(
|
||||
[
|
||||
"07:00 Мультфильмы#0",
|
||||
"07:20 Мультфильмы#1",
|
||||
"07:40 Мультфильмы#2",
|
||||
"20:00 Кино#0",
|
||||
],
|
||||
["07:00 Мультфильмы#0", "07:20 Мультфильмы#1", "07:40 Мультфильмы#2", "20:00 Кино#0"],
|
||||
tape
|
||||
);
|
||||
}
|
||||
@@ -148,9 +141,7 @@ public class GoldenScheduleTests
|
||||
// и разбег накапливается, пока его не подберёт следующий целевой старт.
|
||||
var slots = Enumerable
|
||||
.Range(0, 3)
|
||||
.Select(i =>
|
||||
ContentSlot(Day.AddHours(i), 60, [series], SlotBlockMode.Count, 2)
|
||||
)
|
||||
.Select(i => ContentSlot(Day.AddHours(i), 60, [series], SlotBlockMode.Count, 2))
|
||||
.ToArray();
|
||||
|
||||
var input = new PlanningInput(
|
||||
|
||||
Reference in New Issue
Block a user