feat: make LegacyParityApp playout live-only
This commit is contained in:
@@ -16,17 +16,28 @@ public sealed class LegacyFirstRunSetupNativeContractTests
|
||||
var app = File.ReadAllText(Path.Combine(AppRoot, "App.xaml.cs"))
|
||||
.ReplaceLineEndings("\n");
|
||||
|
||||
Assert.Contains(
|
||||
"var showFirstRunSetup = isSourceOnlyBuild && isDebugBuild;\n" +
|
||||
" _window = showFirstRunSetup\n" +
|
||||
" ? new FirstRunSetupWindow()\n" +
|
||||
" : new MainWindow();",
|
||||
app,
|
||||
var sourceOnlyStart = app.IndexOf("#if SOURCE_ONLY_RUNTIME",
|
||||
StringComparison.Ordinal);
|
||||
Assert.Contains(
|
||||
"var launchArguments = isSourceOnlyBuild\n" +
|
||||
" ? null",
|
||||
app,
|
||||
var fullRuntimeStart = app.IndexOf("#else", sourceOnlyStart,
|
||||
StringComparison.Ordinal);
|
||||
var runtimeEnd = app.IndexOf("#endif", fullRuntimeStart,
|
||||
StringComparison.Ordinal);
|
||||
Assert.True(sourceOnlyStart >= 0);
|
||||
Assert.True(fullRuntimeStart > sourceOnlyStart);
|
||||
Assert.True(runtimeEnd > fullRuntimeStart);
|
||||
|
||||
var sourceOnly = app[sourceOnlyStart..fullRuntimeStart];
|
||||
var fullRuntime = app[fullRuntimeStart..runtimeEnd];
|
||||
Assert.Contains("new FirstRunSetupWindow()", sourceOnly, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("new MainWindow()", sourceOnly, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain(
|
||||
"DevelopmentLiveLaunchBootstrap.TryApply(",
|
||||
sourceOnly,
|
||||
StringComparison.Ordinal);
|
||||
Assert.Contains("DevelopmentLiveLaunchBootstrap.TryApply(", fullRuntime,
|
||||
StringComparison.Ordinal);
|
||||
Assert.Contains("new MainWindow()", fullRuntime, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("new FirstRunSetupWindow()", fullRuntime,
|
||||
StringComparison.Ordinal);
|
||||
Assert.DoesNotContain(
|
||||
"new FirstRunSetupWindow(App.IsDevelopmentLiveLaunch",
|
||||
|
||||
Reference in New Issue
Block a user