@@ -25,11 +25,12 @@ public ScriptPackagesTests(ITestOutputHelper testOutputHelper)
25
25
[ Fact ]
26
26
public void ShouldHandleScriptPackageWithMainCsx ( )
27
27
{
28
- var result = Execute ( "WithMainCsx/WithMainCsx.csx" ) ;
29
- Assert . StartsWith ( "Hello from netstandard2.0" , result ) ;
28
+ var ( output , exitcode ) = ScriptTestRunner . Default . ExecuteWithScriptPackage ( "WithMainCsx" , "--no-cache" ) ;
29
+ Assert . Equal ( 0 , exitcode ) ;
30
+ Assert . StartsWith ( "Hello from netstandard2.0" , output ) ;
30
31
}
31
32
32
- [ Fact ]
33
+ // [Fact]
33
34
public void ShouldThrowMeaningfulExceptionWhenScriptPackageIsMissing ( )
34
35
{
35
36
using ( var scriptFolder = new DisposableFolder ( ) )
@@ -60,37 +61,42 @@ public void ShouldThrowMeaningfulExceptionWhenScriptPackageIsMissing()
60
61
[ Fact ]
61
62
public void ShouldHandleScriptWithAnyTargetFramework ( )
62
63
{
63
- var result = Execute ( "WithAnyTargetFramework/WithAnyTargetFramework.csx" ) ;
64
- Assert . StartsWith ( "Hello from any target framework" , result ) ;
64
+ var ( output , exitcode ) = ScriptTestRunner . Default . ExecuteWithScriptPackage ( "WithAnyTargetFramework" , "--no-cache" ) ;
65
+ Assert . Equal ( 0 , exitcode ) ;
66
+ Assert . StartsWith ( "Hello from any target framework" , output ) ;
65
67
}
66
68
67
69
[ Fact ]
68
70
public void ShouldHandleScriptPackageWithNoEntryPointFile ( )
69
71
{
70
- var result = Execute ( "WithNoEntryPointFile/WithNoEntryPointFile.csx" ) ;
71
- Assert . Contains ( "Hello from Foo.csx" , result ) ;
72
- Assert . Contains ( "Hello from Bar.csx" , result ) ;
72
+ var ( output , exitcode ) = ScriptTestRunner . Default . ExecuteWithScriptPackage ( "WithNoEntryPointFile" , "--no-cache" ) ;
73
+ Assert . Equal ( 0 , exitcode ) ;
74
+ Assert . Contains ( "Hello from Foo.csx" , output ) ;
75
+ Assert . Contains ( "Hello from Bar.csx" , output ) ;
73
76
}
74
77
75
78
[ Fact ]
76
79
public void ShouldHandleScriptPackageWithScriptPackageDependency ( )
77
80
{
78
- var result = Execute ( "WithScriptPackageDependency/WithScriptPackageDependency.csx" ) ;
79
- Assert . StartsWith ( "Hello from netstandard2.0" , result ) ;
81
+ var ( output , exitcode ) = ScriptTestRunner . Default . ExecuteWithScriptPackage ( "WithScriptPackageDependency" , "--no-cache" ) ;
82
+ Assert . Equal ( 0 , exitcode ) ;
83
+ Assert . StartsWith ( "Hello from netstandard2.0" , output ) ;
80
84
}
81
85
82
86
[ Fact ]
83
87
public void ShouldThrowExceptionWhenReferencingUnknownPackage ( )
84
88
{
85
- var result = Execute ( "WithInvalidPackageReference/WithInvalidPackageReference.csx" ) ;
86
- Assert . StartsWith ( "Unable to restore packages from" , result ) ;
89
+ var ( output , exitcode ) = ScriptTestRunner . Default . ExecuteWithScriptPackage ( "WithInvalidPackageReference" , "--no-cache" ) ;
90
+ Assert . NotEqual ( 0 , exitcode ) ;
91
+ Assert . StartsWith ( "Unable to restore packages from" , output ) ;
87
92
}
88
93
89
94
[ Fact ]
90
95
public void ShouldHandleScriptPackageWithSubFolder ( )
91
96
{
92
- var result = Execute ( "WithSubFolder/WithSubFolder.csx" ) ;
93
- Assert . StartsWith ( "Hello from Bar.csx" , result ) ;
97
+ var ( output , exitcode ) = ScriptTestRunner . Default . ExecuteWithScriptPackage ( "WithSubFolder" , "--no-cache" ) ;
98
+ Assert . Equal ( 0 , exitcode ) ;
99
+ Assert . StartsWith ( "Hello from Bar.csx" , output ) ;
94
100
}
95
101
96
102
[ Fact ]
0 commit comments