1111using Microsoft . DotNet . ImageBuilder . Models . Annotations ;
1212using Microsoft . DotNet . ImageBuilder . Models . Oci ;
1313using Microsoft . DotNet . ImageBuilder . Tests . Helpers ;
14+ using Microsoft . Extensions . Logging ;
1415using Moq ;
1516using Newtonsoft . Json ;
16- using Xunit ;
1717using Xunit . Abstractions ;
18+ using Xunit ;
1819
1920namespace Microsoft . DotNet . ImageBuilder . Tests
2021{
@@ -51,9 +52,9 @@ public async Task AnnotateEolDigestsCommand_AnnotationSuccess()
5152
5253 Manifest manifest ;
5354 lifecycleMetadataServiceMock . Verify (
54- o => o . AnnotateEolDigest ( "digest1" , _globalDate , It . IsAny < ILoggerService > ( ) , It . IsAny < bool > ( ) , out manifest ) ) ;
55+ o => o . AnnotateEolDigest ( "digest1" , _globalDate , It . IsAny < ILogger > ( ) , It . IsAny < bool > ( ) , out manifest ) ) ;
5556 lifecycleMetadataServiceMock . Verify (
56- o => o . AnnotateEolDigest ( "digest2" , _specificDigestDate , It . IsAny < ILoggerService > ( ) , It . IsAny < bool > ( ) , out manifest ) ) ;
57+ o => o . AnnotateEolDigest ( "digest2" , _specificDigestDate , It . IsAny < ILogger > ( ) , It . IsAny < bool > ( ) , out manifest ) ) ;
5758
5859 string [ ] expectedAnnotationDigests =
5960 [
@@ -106,7 +107,7 @@ public async Task AnnotateEolDigestsCommand_CheckAnnotations_AlreadyAnnotated_No
106107
107108 Manifest manifest ;
108109 lifecycleMetadataServiceMock . Verify (
109- o => o . AnnotateEolDigest ( It . IsAny < string > ( ) , It . IsAny < DateOnly > ( ) , It . IsAny < ILoggerService > ( ) , It . IsAny < bool > ( ) , out manifest ) ,
110+ o => o . AnnotateEolDigest ( It . IsAny < string > ( ) , It . IsAny < DateOnly > ( ) , It . IsAny < ILogger > ( ) , It . IsAny < bool > ( ) , out manifest ) ,
110111 Times . Never ( ) ) ;
111112 }
112113
@@ -128,7 +129,7 @@ public async Task AnnotateEolDigestsCommand_CheckAnnotations_AlreadyAnnotated_Ma
128129
129130 Manifest manifest ;
130131 lifecycleMetadataServiceMock . Verify (
131- o => o . AnnotateEolDigest ( It . IsAny < string > ( ) , It . IsAny < DateOnly > ( ) , It . IsAny < ILoggerService > ( ) , It . IsAny < bool > ( ) , out manifest ) ,
132+ o => o . AnnotateEolDigest ( It . IsAny < string > ( ) , It . IsAny < DateOnly > ( ) , It . IsAny < ILogger > ( ) , It . IsAny < bool > ( ) , out manifest ) ,
132133 Times . Never ( ) ) ;
133134 }
134135
@@ -152,7 +153,7 @@ private AnnotateEolDigestsCommand InitializeCommand(
152153 string eolDigestsListPath = Path . Combine ( tempFolderContext . Path , "eol-digests.json" ) ;
153154 File . WriteAllText ( eolDigestsListPath , JsonConvert . SerializeObject ( eolAnnotations ) ) ;
154155
155- Mock < ILoggerService > loggerServiceMock = new ( ) ;
156+ Mock < ILogger < AnnotateEolDigestsCommand > > loggerServiceMock = new ( ) ;
156157 lifecycleMetadataServiceMock = CreateLifecycleMetadataServiceMock ( digestAlreadyAnnotated , digestAnnotationIsSuccessful , useNonMatchingDate ) ;
157158 AnnotateEolDigestsCommand command = new (
158159 loggerServiceMock . Object ,
@@ -177,7 +178,7 @@ private Mock<ILifecycleMetadataService> CreateLifecycleMetadataServiceMock(bool
177178 } ;
178179
179180 lifecycleMetadataServiceMock
180- . Setup ( o => o . AnnotateEolDigest ( It . Is < string > ( digest => digest . Contains ( "digest1" ) ) , It . IsAny < DateOnly > ( ) , It . IsAny < ILoggerService > ( ) , It . IsAny < bool > ( ) , out digest1Annotation ) )
181+ . Setup ( o => o . AnnotateEolDigest ( It . Is < string > ( digest => digest . Contains ( "digest1" ) ) , It . IsAny < DateOnly > ( ) , It . IsAny < ILogger > ( ) , It . IsAny < bool > ( ) , out digest1Annotation ) )
181182 . Returns ( digestAnnotationIsSuccessful ) ;
182183
183184 Manifest digest2Annotation = new ( )
@@ -186,7 +187,7 @@ private Mock<ILifecycleMetadataService> CreateLifecycleMetadataServiceMock(bool
186187 } ;
187188
188189 lifecycleMetadataServiceMock
189- . Setup ( o => o . AnnotateEolDigest ( It . Is < string > ( digest => digest . Contains ( "digest2" ) ) , It . IsAny < DateOnly > ( ) , It . IsAny < ILoggerService > ( ) , It . IsAny < bool > ( ) , out digest2Annotation ) )
190+ . Setup ( o => o . AnnotateEolDigest ( It . Is < string > ( digest => digest . Contains ( "digest2" ) ) , It . IsAny < DateOnly > ( ) , It . IsAny < ILogger > ( ) , It . IsAny < bool > ( ) , out digest2Annotation ) )
190191 . Returns ( digestAnnotationIsSuccessful ) ;
191192
192193 return lifecycleMetadataServiceMock ;
@@ -213,7 +214,7 @@ private static void SetupIsDigestAnnotatedForEolMethod(Mock<ILifecycleMetadataSe
213214 }
214215
215216 lifecycleMetadataServiceMock
216- . Setup ( o => o . IsDigestAnnotatedForEol ( digest , It . IsAny < ILoggerService > ( ) , It . IsAny < bool > ( ) , out manifest ) )
217+ . Setup ( o => o . IsDigestAnnotatedForEol ( digest , It . IsAny < ILogger > ( ) , It . IsAny < bool > ( ) , out manifest ) )
217218 . Returns ( digestAlreadyAnnotated ) ;
218219 }
219220 }
0 commit comments