@@ -75,11 +75,11 @@ public void RunTestsWithSourcesShouldNotExecuteTestsIfTestSettingsIsGiven()
7575 {
7676 var sources = new List < string > { Assembly . GetExecutingAssembly ( ) . Location } ;
7777 string runSettingxml =
78- @"<RunSettings>
78+ @"<RunSettings>
7979 <MSTest>
8080 <SettingsFile>DummyPath\\TestSettings1.testsettings</SettingsFile>
8181 <ForcedLegacyMode>true</ForcedLegacyMode>
82- <IgnoreTestImpact>true</IgnoreTestImpact>
82+ <IgnoreTestImpact>true</IgnoreTestImpact>
8383 </MSTest>
8484 </RunSettings>" ;
8585 this . mockRunContext . Setup ( dc => dc . RunSettings ) . Returns ( this . mockRunSettings . Object ) ;
@@ -89,5 +89,36 @@ public void RunTestsWithSourcesShouldNotExecuteTestsIfTestSettingsIsGiven()
8989 // Test should not start if TestSettings is given.
9090 this . mockFrameworkHandle . Verify ( fh => fh . RecordStart ( It . IsAny < TestCase > ( ) ) , Times . Never ) ;
9191 }
92+
93+ [ TestMethod ]
94+ public void RunTestsWithSourcesShouldSetDefaultDesignModeAsTrue ( )
95+ {
96+ var sources = new List < string > { Assembly . GetExecutingAssembly ( ) . Location } ;
97+ string runSettingxml =
98+ @"<RunSettings>
99+ </RunSettings>" ;
100+ this . mockRunContext . Setup ( dc => dc . RunSettings ) . Returns ( this . mockRunSettings . Object ) ;
101+ this . mockRunSettings . Setup ( rs => rs . SettingsXml ) . Returns ( runSettingxml ) ;
102+ this . mstestExecutor . RunTests ( sources , this . mockRunContext . Object , this . mockFrameworkHandle . Object ) ;
103+
104+ Assert . IsTrue ( RunConfigurationSettings . ConfigurationSettings . DesignMode ) ;
105+ }
106+
107+ [ TestMethod ]
108+ public void RunTestsWithSourcesShouldSetDesignModeAsFalseIfSpecifiedInRunSettings ( )
109+ {
110+ var sources = new List < string > { Assembly . GetExecutingAssembly ( ) . Location } ;
111+ string runSettingxml =
112+ @"<RunSettings>
113+ <RunConfiguration>
114+ <DesignMode>false</DesignMode>
115+ </RunConfiguration>
116+ </RunSettings>" ;
117+ this . mockRunContext . Setup ( dc => dc . RunSettings ) . Returns ( this . mockRunSettings . Object ) ;
118+ this . mockRunSettings . Setup ( rs => rs . SettingsXml ) . Returns ( runSettingxml ) ;
119+ this . mstestExecutor . RunTests ( sources , this . mockRunContext . Object , this . mockFrameworkHandle . Object ) ;
120+
121+ Assert . IsFalse ( RunConfigurationSettings . ConfigurationSettings . DesignMode ) ;
122+ }
92123 }
93124}
0 commit comments