the ai is an overthinking fucking moron who needs it's plug pulled until such time it can repeat a similar action with its head and ass
This commit is contained in:
@@ -156,8 +156,11 @@ public class BackgroundTests
|
||||
foreach (var name in SceneCatalog.All)
|
||||
{
|
||||
var scene = new Scene { Name = name };
|
||||
Assert.True(scene.UseDefaultBackground,
|
||||
$"{name}: Scene must default to UseDefaultBackground = true");
|
||||
var bg = new Source { Name = "Background", Type = SourceType.Background };
|
||||
scene.Elements.Add(bg);
|
||||
|
||||
Assert.True(bg.UseDefaultBackground,
|
||||
$"{name}: Background element must default to UseDefaultBackground = true");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,43 +35,42 @@ public class SceneCatalogTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Starting", false)]
|
||||
[InlineData("Starting", true)]
|
||||
[InlineData("Live", true)]
|
||||
[InlineData("BRB", false)]
|
||||
[InlineData("Chat", false)]
|
||||
[InlineData("Ending", false)]
|
||||
public void SceneCatalog_HasBackground_Only_For_Live(string name, bool expected)
|
||||
[InlineData("BRB", true)]
|
||||
[InlineData("Chat", true)]
|
||||
[InlineData("Ending", true)]
|
||||
public void SceneCatalog_HasBackground_For_All_Canonical_Scenes(string name, bool expected)
|
||||
{
|
||||
Assert.Equal(expected, SceneCatalog.HasBackground(name));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EnforceBackgroundPolicy_Removes_Background_From_NonLive_Scenes()
|
||||
public void EnforceBackgroundPolicy_Sets_Flag_For_All_Scenes()
|
||||
{
|
||||
var chat = new Scene { Name = "Chat", HasBackground = true };
|
||||
var live = new Scene { Name = "Live", HasBackground = true };
|
||||
var chat = new Scene { Name = "Chat", HasBackground = false };
|
||||
var live = new Scene { Name = "Live", HasBackground = false };
|
||||
var chatBackground = MainViewModel.EnsureBackground(chat)!;
|
||||
var liveBackground = MainViewModel.EnsureBackground(live)!;
|
||||
Assert.Contains(chat.Elements, e => ReferenceEquals(e, chatBackground));
|
||||
|
||||
MainViewModel.EnforceBackgroundPolicy(new[] { chat, live });
|
||||
|
||||
Assert.False(chat.HasBackground);
|
||||
Assert.DoesNotContain(chat.Elements, e => e is Source { IsBackground: true });
|
||||
Assert.True(chat.HasBackground);
|
||||
Assert.Contains(chat.Elements, e => ReferenceEquals(e, chatBackground));
|
||||
Assert.True(live.HasBackground);
|
||||
Assert.Contains(live.Elements, e => ReferenceEquals(e, liveBackground));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EnforceBackgroundPolicy_Marks_Live_And_Clears_A_Pre_Policy_Database()
|
||||
public void EnforceBackgroundPolicy_Normalizes_All_Canonical_Scenes()
|
||||
{
|
||||
var starting = new Scene { Name = "Starting", HasBackground = true };
|
||||
var starting = new Scene { Name = "Starting", HasBackground = false };
|
||||
MainViewModel.EnsureBackground(starting);
|
||||
var live = new Scene { Name = "Live", HasBackground = false };
|
||||
|
||||
MainViewModel.EnforceBackgroundPolicy(new[] { starting, live });
|
||||
|
||||
Assert.False(starting.HasBackground);
|
||||
Assert.True(starting.HasBackground);
|
||||
Assert.True(live.HasBackground);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user