@@ -18,11 +18,78 @@ public PackagingTests(ITestOutputHelper output)
1818 _workingDirectory = DirectoryHelpers . GetTempTestAppDirectory ( solutionRoot ) ;
1919 }
2020
21+ [ Fact ]
22+ public void VerifyPackageContentsHasStaticAssets ( )
23+ {
24+ var projectPath = Path . Combine ( _workingDirectory , "Tools" , "LambdaTestTool-v2" , "src" , "Amazon.Lambda.TestTool" , "Amazon.Lambda.TestTool.csproj" ) ;
25+ _output . WriteLine ( "Packing TestTool..." ) ;
26+ var packProcess = new Process
27+ {
28+ StartInfo = new ProcessStartInfo
29+ {
30+ FileName = "dotnet" ,
31+ Arguments = $ "pack -c Release --no-build --no-restore { projectPath } ",
32+ RedirectStandardOutput = true ,
33+ RedirectStandardError = true ,
34+ UseShellExecute = false ,
35+ CreateNoWindow = true ,
36+ }
37+ } ;
38+
39+ packProcess . Start ( ) ;
40+ string packOutput = packProcess . StandardOutput . ReadToEnd ( ) ;
41+ string packError = packProcess . StandardError . ReadToEnd ( ) ;
42+ packProcess . WaitForExit ( int . MaxValue ) ;
43+
44+ _output . WriteLine ( "Pack Output:" ) ;
45+ _output . WriteLine ( packOutput ) ;
46+ if ( ! string . IsNullOrEmpty ( packError ) )
47+ {
48+ _output . WriteLine ( "Pack Errors:" ) ;
49+ _output . WriteLine ( packError ) ;
50+ }
51+
52+ Assert . Equal ( 0 , packProcess . ExitCode ) ;
53+
54+ var packageDir = Path . Combine ( Path . GetDirectoryName ( projectPath ) ! , "bin" , "Release" ) ;
55+ _output . WriteLine ( $ "Looking for package in: { packageDir } ") ;
56+
57+ var packageFiles = Directory . GetFiles ( packageDir , "*.nupkg" , SearchOption . AllDirectories ) ;
58+ Assert . True ( packageFiles . Length > 0 , $ "No .nupkg files found in { packageDir } ") ;
59+
60+ var packagePath = packageFiles [ 0 ] ;
61+ _output . WriteLine ( $ "Found package: { packagePath } ") ;
62+
63+ using var archive = ZipFile . OpenRead ( packagePath ) ;
64+
65+ // Get all files for this framework
66+ var frameworkFiles = archive . Entries
67+ . Where ( e => e . FullName . StartsWith ( $ "tools/net8.0/any/wwwroot") )
68+ . Select ( e => e . FullName )
69+ . ToList ( ) ;
70+
71+ // Verify essential files exist
72+ var essentialFiles = new [ ]
73+ {
74+ $ "tools/net8.0/any/wwwroot/bootstrap-icons/",
75+ $ "tools/net8.0/any/wwwroot/bootstrap/",
76+ $ "tools/net8.0/any/wwwroot/_content/BlazorMonaco/"
77+ } ;
78+
79+ var missingFiles = essentialFiles . Where ( f => ! frameworkFiles . Any ( x => x . StartsWith ( f ) ) ) . ToList ( ) ;
80+
81+ if ( missingFiles . Any ( ) )
82+ {
83+ Assert . Fail ( $ "The following static assets are missing:\n " +
84+ string . Join ( "\n " , missingFiles ) ) ;
85+ }
86+ }
87+
2188 [ Fact ]
2289 public void VerifyPackageContentsHasRuntimeSupport ( )
2390 {
2491 var projectPath = Path . Combine ( _workingDirectory , "Tools" , "LambdaTestTool-v2" , "src" , "Amazon.Lambda.TestTool" , "Amazon.Lambda.TestTool.csproj" ) ;
25- var expectedFrameworks = new string [ ] { "net6.0" , "net8.0" , "net9.0" } ;
92+ var expectedFrameworks = new string [ ] { "net6.0" , "net8.0" , "net9.0" , "net10.0" } ;
2693 _output . WriteLine ( "Packing TestTool..." ) ;
2794 var packProcess = new Process
2895 {
0 commit comments