@@ -9,19 +9,21 @@ public class ParseContainerPropertiesTests
9
9
[ TestMethod ]
10
10
public void Baseline ( )
11
11
{
12
- ParseContainerProperties task = new ParseContainerProperties ( ) ;
13
- task . FullyQualifiedBaseImageName = "mcr.microsoft.com/dotnet/runtime:6.0" ;
14
- task . ContainerRegistry = "localhost:5010" ;
15
- task . ContainerImageName = "dotnet/testimage" ;
16
- task . ContainerImageTags = new [ ] { "5.0" , "latest" } ;
12
+ var ( project , _) = Evaluator . InitProject ( new ( ) {
13
+ [ ContainerBaseImage ] = "mcr.microsoft.com/dotnet/runtime:7.0" ,
14
+ [ ContainerRegistry ] = "localhost:5010" ,
15
+ [ ContainerImageName ] = "dotnet/testimage" ,
16
+ [ ContainerImageTags ] = "7.0;latest"
17
+ } ) ;
18
+ var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
19
+ Assert . IsTrue ( instance . Build ( new [ ] { ComputeContainerConfig } , null , null , out var outputs ) ) ;
17
20
18
- Assert . IsTrue ( task . Execute ( ) ) ;
19
- Assert . AreEqual ( "mcr.microsoft.com" , task . ParsedContainerRegistry ) ;
20
- Assert . AreEqual ( "dotnet/runtime" , task . ParsedContainerImage ) ;
21
- Assert . AreEqual ( "6.0" , task . ParsedContainerTag ) ;
21
+ Assert . AreEqual ( "mcr.microsoft.com" , instance . GetPropertyValue ( ContainerBaseRegistry ) ) ;
22
+ Assert . AreEqual ( "dotnet/runtime" , instance . GetPropertyValue ( ContainerBaseName ) ) ;
23
+ Assert . AreEqual ( "7.0" , instance . GetPropertyValue ( ContainerBaseTag ) ) ;
22
24
23
25
Assert . AreEqual ( "dotnet/testimage" , task . NewContainerImageName ) ;
24
- CollectionAssert . AreEquivalent ( new [ ] { "5 .0" , "latest" } , task . NewContainerTags ) ;
26
+ CollectionAssert . AreEquivalent ( new [ ] { "7 .0" , "latest" } , task . NewContainerTags ) ;
25
27
}
26
28
27
29
[ TestMethod ]
@@ -66,7 +68,7 @@ public void UserRegistriesWithNoSchemeGetHttps()
66
68
public void SpacesGetReplacedWithDashes ( )
67
69
{
68
70
var ( project , _) = Evaluator . InitProject ( new ( ) {
69
- [ ContainerBaseImage ] = "mcr microsoft com/dotnet runtime:6 .0" ,
71
+ [ ContainerBaseImage ] = "mcr microsoft com/dotnet runtime:7 .0" ,
70
72
[ ContainerRegistry ] = "localhost:5010"
71
73
} ) ;
72
74
@@ -75,14 +77,14 @@ public void SpacesGetReplacedWithDashes()
75
77
76
78
Assert . AreEqual ( "mcr-microsoft-com" , instance . GetPropertyValue ( ContainerBaseRegistry ) ) ;
77
79
Assert . AreEqual ( "dotnet-runtime" , instance . GetPropertyValue ( ContainerBaseName ) ) ;
78
- Assert . AreEqual ( "6 .0" , instance . GetPropertyValue ( ContainerBaseTag ) ) ;
80
+ Assert . AreEqual ( "7 .0" , instance . GetPropertyValue ( ContainerBaseTag ) ) ;
79
81
}
80
82
81
83
[ TestMethod ]
82
84
public void RegexCatchesInvalidContainerNames ( )
83
85
{
84
86
var ( project , logs ) = Evaluator . InitProject ( new ( ) {
85
- [ ContainerBaseImage ] = "mcr.microsoft.com/dotnet/runtime:6 .0" ,
87
+ [ ContainerBaseImage ] = "mcr.microsoft.com/dotnet/runtime:7 .0" ,
86
88
[ ContainerRegistry ] = "localhost:5010" ,
87
89
[ ContainerImageName ] = "dotnet testimage" ,
88
90
[ ContainerImageTag ] = "5.0"
@@ -98,7 +100,7 @@ public void RegexCatchesInvalidContainerNames()
98
100
public void RegexCatchesInvalidContainerTags ( )
99
101
{
100
102
var ( project , logs ) = Evaluator . InitProject ( new ( ) {
101
- [ ContainerBaseImage ] = "mcr.microsoft.com/dotnet/runtime:6 .0" ,
103
+ [ ContainerBaseImage ] = "mcr.microsoft.com/dotnet/runtime:7 .0" ,
102
104
[ ContainerRegistry ] = "localhost:5010" ,
103
105
[ ContainerImageName ] = "dotnet/testimage" ,
104
106
[ ContainerImageTag ] = "5 0"
@@ -115,7 +117,7 @@ public void RegexCatchesInvalidContainerTags()
115
117
public void CanOnlySupplyOneOfTagAndTags ( )
116
118
{
117
119
var ( project , logs ) = Evaluator . InitProject ( new ( ) {
118
- [ ContainerBaseImage ] = "mcr.microsoft.com/dotnet/runtime:6 .0" ,
120
+ [ ContainerBaseImage ] = "mcr.microsoft.com/dotnet/runtime:7 .0" ,
119
121
[ ContainerRegistry ] = "localhost:5010" ,
120
122
[ ContainerImageName ] = "dotnet/testimage" ,
121
123
[ ContainerImageTag ] = "5.0" ,
0 commit comments