@@ -9,7 +9,7 @@ namespace Test
9
9
{
10
10
public class DotNetFixture : IDisposable
11
11
{
12
- private static string RelativeTemplatePath = @"../../../../content/dotnet-template-azure-iot-edge-module/CSharp/ " ;
12
+ private static string RelativeTemplatePath = @"../../../../content/dotnet-template-azure-iot-edge-module/" ;
13
13
public DotNetFixture ( )
14
14
{
15
15
Process . Start ( "dotnet" , "new -i " + RelativeTemplatePath ) . WaitForExit ( ) ;
@@ -30,6 +30,8 @@ public class Test : IClassFixture<DotNetFixture>
30
30
private DotNetFixture fixture ;
31
31
private const string TargetAll = "all" ;
32
32
private const string TargetDeploy = "deploy" ;
33
+ private const string CSharp = "C#" ;
34
+ private const string FSharp = "F#" ;
33
35
private const string ArchLinux64 = "linux64" ;
34
36
private const string ArchWindowsNano = "windowsNano" ;
35
37
@@ -60,35 +62,58 @@ public Test(DotNetFixture fixture)
60
62
}
61
63
} ;
62
64
63
- private static string BeforeEach ( string target = TargetAll , bool linux64 = true , bool windowsNano = true , bool skipRestore = false )
65
+ private static string BeforeEach ( string lang , string target , bool linux64 = true , bool windowsNano = true , bool skipRestore = false )
64
66
{
65
67
var scaffoldName = Path . GetRandomFileName ( ) . Replace ( "." , "" ) . ToString ( ) ;
66
- FlagFilesMapping [ TargetAll ] = new List < string > { scaffoldName + ".csproj" , "Program.cs" , ".gitignore" } ;
67
- var command = "new aziotedgemodule -n " + scaffoldName + " -t " + target + " -lx " + linux64 + " -wn " + windowsNano + " -s " + skipRestore ;
68
+ if ( lang == CSharp )
69
+ {
70
+ FlagFilesMapping [ TargetAll ] = new List < string > { scaffoldName + ".csproj" , "Program.cs" , ".gitignore" } ;
71
+ }
72
+ if ( lang == FSharp )
73
+ {
74
+ FlagFilesMapping [ TargetAll ] = new List < string > { scaffoldName + ".fsproj" , "Program.fs" , ".gitignore" } ;
75
+ }
76
+ var command = "new aziotedgemodule -n " + scaffoldName + " -lang " + lang + " -t " + target + " -lx " + linux64 + " -wn " + windowsNano + " -s " + skipRestore ;
68
77
Process . Start ( "dotnet" , command ) . WaitForExit ( ) ;
69
78
return scaffoldName ;
70
79
}
71
80
72
81
[ Theory ]
73
- [ InlineData ( TargetAll , true , true , true ) ]
74
- [ InlineData ( TargetAll , true , true , false ) ]
75
- [ InlineData ( TargetAll , true , false , true ) ]
76
- [ InlineData ( TargetAll , true , false , false ) ]
77
- [ InlineData ( TargetAll , false , true , true ) ]
78
- [ InlineData ( TargetAll , false , true , false ) ]
79
- [ InlineData ( TargetAll , false , false , true ) ]
80
- [ InlineData ( TargetAll , false , false , false ) ]
81
- [ InlineData ( TargetDeploy , true , true , true ) ]
82
- [ InlineData ( TargetDeploy , true , true , false ) ]
83
- [ InlineData ( TargetDeploy , true , false , true ) ]
84
- [ InlineData ( TargetDeploy , true , false , false ) ]
85
- [ InlineData ( TargetDeploy , false , true , true ) ]
86
- [ InlineData ( TargetDeploy , false , true , false ) ]
87
- [ InlineData ( TargetDeploy , false , false , true ) ]
88
- [ InlineData ( TargetDeploy , false , false , false ) ]
89
- public void TestArchitecture ( string target , bool linux64 , bool windowsNano , bool skipRestore )
82
+ [ InlineData ( CSharp , TargetAll , true , true , true ) ]
83
+ [ InlineData ( CSharp , TargetAll , true , true , false ) ]
84
+ [ InlineData ( CSharp , TargetAll , true , false , true ) ]
85
+ [ InlineData ( CSharp , TargetAll , true , false , false ) ]
86
+ [ InlineData ( CSharp , TargetAll , false , true , true ) ]
87
+ [ InlineData ( CSharp , TargetAll , false , true , false ) ]
88
+ [ InlineData ( CSharp , TargetAll , false , false , true ) ]
89
+ [ InlineData ( CSharp , TargetAll , false , false , false ) ]
90
+ [ InlineData ( CSharp , TargetDeploy , true , true , true ) ]
91
+ [ InlineData ( CSharp , TargetDeploy , true , true , false ) ]
92
+ [ InlineData ( CSharp , TargetDeploy , true , false , true ) ]
93
+ [ InlineData ( CSharp , TargetDeploy , true , false , false ) ]
94
+ [ InlineData ( CSharp , TargetDeploy , false , true , true ) ]
95
+ [ InlineData ( CSharp , TargetDeploy , false , true , false ) ]
96
+ [ InlineData ( CSharp , TargetDeploy , false , false , true ) ]
97
+ [ InlineData ( CSharp , TargetDeploy , false , false , false ) ]
98
+ [ InlineData ( FSharp , TargetAll , true , true , true ) ]
99
+ [ InlineData ( FSharp , TargetAll , true , true , false ) ]
100
+ [ InlineData ( FSharp , TargetAll , true , false , true ) ]
101
+ [ InlineData ( FSharp , TargetAll , true , false , false ) ]
102
+ [ InlineData ( FSharp , TargetAll , false , true , true ) ]
103
+ [ InlineData ( FSharp , TargetAll , false , true , false ) ]
104
+ [ InlineData ( FSharp , TargetAll , false , false , true ) ]
105
+ [ InlineData ( FSharp , TargetAll , false , false , false ) ]
106
+ [ InlineData ( FSharp , TargetDeploy , true , true , true ) ]
107
+ [ InlineData ( FSharp , TargetDeploy , true , true , false ) ]
108
+ [ InlineData ( FSharp , TargetDeploy , true , false , true ) ]
109
+ [ InlineData ( FSharp , TargetDeploy , true , false , false ) ]
110
+ [ InlineData ( FSharp , TargetDeploy , false , true , true ) ]
111
+ [ InlineData ( FSharp , TargetDeploy , false , true , false ) ]
112
+ [ InlineData ( FSharp , TargetDeploy , false , false , true ) ]
113
+ [ InlineData ( FSharp , TargetDeploy , false , false , false ) ]
114
+ public void TestArchitecture ( string lang , string target , bool linux64 , bool windowsNano , bool skipRestore )
90
115
{
91
- var scaffoldName = BeforeEach ( target , linux64 , windowsNano , skipRestore ) ;
116
+ var scaffoldName = BeforeEach ( lang , target , linux64 , windowsNano , skipRestore ) ;
92
117
var filesToCheck = new List < string > ( ) ;
93
118
if ( target == TargetDeploy )
94
119
{
@@ -125,10 +150,12 @@ public void TestArchitecture(string target, bool linux64, bool windowsNano, bool
125
150
Directory . Delete ( scaffoldName , true ) ;
126
151
}
127
152
128
- [ Fact ]
129
- public void TestDeployUnnecessaryFiles ( )
153
+ [ Theory ]
154
+ [ InlineData ( CSharp ) ]
155
+ [ InlineData ( FSharp ) ]
156
+ public void TestDeployUnnecessaryFiles ( string lang )
130
157
{
131
- var scaffoldName = BeforeEach ( TargetDeploy ) ;
158
+ var scaffoldName = BeforeEach ( lang , TargetDeploy ) ;
132
159
var filesExistsToCheck = FlagFilesMapping [ TargetDeploy ] ;
133
160
var filesNonExistsToCheck = FlagFilesMapping [ ArchLinux64 ] . Union ( FlagFilesMapping [ ArchWindowsNano ] ) . Union ( FlagFilesMapping [ TargetAll ] ) ;
134
161
0 commit comments