88using JWT . Builder ;
99using Microsoft . Extensions . Configuration ;
1010using Microsoft . Extensions . Logging ;
11- using Moq ;
1211using MalwareSampleExchange . Console . ListRequester ;
1312using Xunit ;
1413using JWT . Algorithms ;
1716using MalwareSampleExchange . Console . Partner ;
1817using MalwareSampleExchange . Console . SampleStorage ;
1918using Microsoft . Extensions . Hosting ;
19+ using NSubstitute ;
2020
2121namespace MalwareSampleExchange . Console_Test ;
2222
@@ -38,26 +38,26 @@ public SampleExchangeTest(MongoDockerFixture mongoDockerFixture)
3838
3939 private static PartnerProvider CreatePartnerProvider ( )
4040 {
41- return new PartnerProvider ( Mock . Of < ILogger < PartnerProvider > > ( ) ,
41+ return new PartnerProvider ( Substitute . For < ILogger < PartnerProvider > > ( ) ,
4242 new OptionsWrapper < PartnerProviderOptions > ( new PartnerProviderOptions
4343 {
4444 FilePath = Configuration [ "Config:FilePath" ] !
45- } ) , Mock . Of < IHostApplicationLifetime > ( ) , new HttpClient ( ) ) ;
45+ } ) , Substitute . For < IHostApplicationLifetime > ( ) , new HttpClient ( ) ) ;
4646 }
4747
4848 private static ISampleStorageHandler CreateSampleGetter ( )
4949 {
5050 var options = new FileStorageOptions ( ) ;
5151 Configuration . GetSection ( "Storage" ) . Bind ( options ) ;
5252
53- var sampleGetter = new FileSampleStorageHandler ( Mock . Of < ILogger < FileSampleStorageHandler > > ( ) ,
53+ var sampleGetter = new FileSampleStorageHandler ( Substitute . For < ILogger < FileSampleStorageHandler > > ( ) ,
5454 new OptionsWrapper < FileStorageOptions > ( options ) ) ;
5555 return sampleGetter ;
5656 }
5757
5858 private ListRequester CreateListRequester ( ISampleMetadataHandler ? sampleMetadataReader = null )
5959 {
60- sampleMetadataReader ??= Mock . Of < ISampleMetadataHandler > ( ) ;
60+ sampleMetadataReader ??= Substitute . For < ISampleMetadataHandler > ( ) ;
6161 var options = new ListRequesterOptions ( ) ;
6262 Configuration . GetSection ( "Token" ) . Bind ( options ) ;
6363 return new ListRequester ( new OptionsWrapper < ListRequesterOptions > ( options ) ,
0 commit comments