@@ -139,8 +139,7 @@ public void ShouldAddNewReferencesIfTheyAreProvided(
139139
140140 var session = new SessionState < Evaluator > { Session = new Evaluator ( new CompilerContext ( new CompilerSettings ( ) , new ConsoleReportPrinter ( ) ) ) } ;
141141 scriptPackSession . State [ MonoScriptEngine . SessionKey ] = session ;
142- var refs = new AssemblyReferences ( ) ;
143- refs . PathReferences . Add ( "System" ) ;
142+ var refs = new AssemblyReferences ( new [ ] { "System" } ) ;
144143
145144 // Act
146145 engine . Execute ( Code , new string [ 0 ] , refs , Enumerable . Empty < string > ( ) , scriptPackSession ) ;
@@ -163,8 +162,7 @@ public void ShouldReturnAScriptResult(
163162
164163 var session = new SessionState < Evaluator > { Session = new Evaluator ( new CompilerContext ( new CompilerSettings ( ) , new ConsoleReportPrinter ( ) ) ) } ;
165164 scriptPackSession . State [ MonoScriptEngine . SessionKey ] = session ;
166- var refs = new AssemblyReferences ( ) ;
167- refs . PathReferences . Add ( "System" ) ;
165+ var refs = new AssemblyReferences ( new [ ] { "System" } ) ;
168166
169167 // Act
170168 var result = engine . Execute ( code , new string [ 0 ] , refs , Enumerable . Empty < string > ( ) , scriptPackSession ) ;
@@ -217,8 +215,7 @@ public void ShouldNotReturnCompileExceptionIfCodeDoesCompile(
217215
218216 var session = new SessionState < Evaluator > { Session = new Evaluator ( new CompilerContext ( new CompilerSettings ( ) , new ConsoleReportPrinter ( ) ) ) } ;
219217 scriptPackSession . State [ MonoScriptEngine . SessionKey ] = session ;
220- var refs = new AssemblyReferences ( ) ;
221- refs . PathReferences . Add ( "System" ) ;
218+ var refs = new AssemblyReferences ( new [ ] { "System" } ) ;
222219
223220 // Act
224221 var result = engine . Execute ( Code , new string [ 0 ] , refs , Enumerable . Empty < string > ( ) , scriptPackSession ) ;
@@ -243,8 +240,7 @@ public void ShouldReturnExecuteExceptionIfCodeExecutionThrowsException(
243240
244241 var session = new SessionState < Evaluator > { Session = new Evaluator ( new CompilerContext ( new CompilerSettings ( ) , new ConsoleReportPrinter ( ) ) ) } ;
245242 scriptPackSession . State [ MonoScriptEngine . SessionKey ] = session ;
246- var refs = new AssemblyReferences ( ) ;
247- refs . PathReferences . Add ( "System" ) ;
243+ var refs = new AssemblyReferences ( new [ ] { "System" } ) ;
248244
249245 // Act
250246 var result = engine . Execute ( Code , new string [ 0 ] , refs , Enumerable . Empty < string > ( ) , scriptPackSession ) ;
@@ -267,8 +263,7 @@ public void ShouldNotReturnExecuteExceptionIfCodeExecutionDoesNotThrowAnExceptio
267263
268264 var session = new SessionState < Evaluator > { Session = new Evaluator ( new CompilerContext ( new CompilerSettings ( ) , new ConsoleReportPrinter ( ) ) ) } ;
269265 scriptPackSession . State [ MonoScriptEngine . SessionKey ] = session ;
270- var refs = new AssemblyReferences ( ) ;
271- refs . PathReferences . Add ( "System" ) ;
266+ var refs = new AssemblyReferences ( new [ ] { "System" } ) ;
272267
273268 // Act
274269 var result = engine . Execute ( Code , new string [ 0 ] , refs , Enumerable . Empty < string > ( ) , scriptPackSession ) ;
@@ -292,8 +287,7 @@ public void ShouldReturnReturnValueIfCodeExecutionReturnsValue(
292287
293288 var session = new SessionState < Evaluator > { Session = new Evaluator ( new CompilerContext ( new CompilerSettings ( ) , new ConsoleReportPrinter ( ) ) ) } ;
294289 scriptPackSession . State [ MonoScriptEngine . SessionKey ] = session ;
295- var refs = new AssemblyReferences ( ) ;
296- refs . PathReferences . Add ( "System" ) ;
290+ var refs = new AssemblyReferences ( new [ ] { "System" } ) ;
297291
298292 // Act
299293 var result = engine . Execute ( Code , new string [ 0 ] , refs , Enumerable . Empty < string > ( ) , scriptPackSession ) ;
@@ -316,8 +310,7 @@ public void ShouldNotReturnReturnValueIfCodeExecutionDoesNotReturnValue(
316310
317311 var session = new SessionState < Evaluator > { Session = new Evaluator ( new CompilerContext ( new CompilerSettings ( ) , new ConsoleReportPrinter ( ) ) ) } ;
318312 scriptPackSession . State [ MonoScriptEngine . SessionKey ] = session ;
319- var refs = new AssemblyReferences ( ) ;
320- refs . PathReferences . Add ( "System" ) ;
313+ var refs = new AssemblyReferences ( new [ ] { "System" } ) ;
321314
322315 // Act
323316 var result = engine . Execute ( Code , new string [ 0 ] , refs , Enumerable . Empty < string > ( ) , scriptPackSession ) ;
@@ -337,8 +330,7 @@ ScriptPackSession scriptPackSession
337330 // Arrange
338331 const string Code = "var theNumber = 42; //this should compile" ;
339332
340- var refs = new AssemblyReferences ( ) ;
341- refs . PathReferences . Add ( "System" ) ;
333+ var refs = new AssemblyReferences ( new [ ] { "System" } ) ;
342334
343335 scriptHostFactory . Setup ( s => s . CreateScriptHost ( It . IsAny < IScriptPackManager > ( ) , It . IsAny < string [ ] > ( ) ) )
344336 . Returns ( new ScriptHost ( manager . Object , null ) ) ;
0 commit comments