@@ -624,6 +624,7 @@ private class TestRazorProjectInfoPublisher : RazorProjectInfoPublisher
624
624
625
625
private readonly bool _shouldSerialize ;
626
626
private readonly bool _useRealShouldSerialize ;
627
+ private readonly bool _configurationFileExists ;
627
628
628
629
static TestRazorProjectInfoPublisher ( )
629
630
{
@@ -636,17 +637,19 @@ public TestRazorProjectInfoPublisher(
636
637
ProjectConfigurationFilePathStore projectStatePublishFilePathStore ,
637
638
Action < IProjectSnapshot , string > onSerializeToFile = null ,
638
639
bool shouldSerialize = true ,
639
- bool useRealShouldSerialize = false )
640
+ bool useRealShouldSerialize = false ,
641
+ bool configurationFileExists = true )
640
642
: base ( s_lspEditorFeatureDetector . Object , projectStatePublishFilePathStore , TestRazorLogger . Instance )
641
643
{
642
644
_onSerializeToFile = onSerializeToFile ?? ( ( _1 , _2 ) => throw new XunitException ( "SerializeToFile should not have been called." ) ) ;
643
645
_shouldSerialize = shouldSerialize ;
644
646
_useRealShouldSerialize = useRealShouldSerialize ;
647
+ _configurationFileExists = configurationFileExists ;
645
648
}
646
649
647
650
protected override bool FileExists ( string file )
648
651
{
649
- return true ;
652
+ return _configurationFileExists ;
650
653
}
651
654
652
655
protected override void SerializeToFile ( IProjectSnapshot projectSnapshot , string configurationFilePath ) => _onSerializeToFile ? . Invoke ( projectSnapshot , configurationFilePath ) ;
0 commit comments