@@ -69,33 +69,41 @@ public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithFieldsIsCorrect(
6969 var product = new Product
7070 {
7171 Name = "Red T-shirt" ,
72+ Description = string . Empty ,
7273 Price = 995.00
7374 } ;
7475
75- const string updateCode = "product.Price *= 1.15;" ;
76+ const string updateCode = @"product.Description = null;
77+ product.Price *= 1.15;" ;
7678
7779 const string input1 = "product.Name" ;
7880 const string targetOutput1 = "Red T-shirt" ;
7981
80- const string input2 = "product.Price" ;
81- const double targetOutput2 = 1144.25 ;
82+ const string input2 = "product.Description" ;
83+ const string targetOutput2 = null ;
84+
85+ const string input3 = "product.Price" ;
86+ const double targetOutput3 = 1144.25 ;
8287
8388 // Act
8489 string output1 ;
85- double output2 ;
90+ string output2 ;
91+ double output3 ;
8692
8793 using ( var jsEngine = CreateJsEngine ( ) )
8894 {
8995 jsEngine . EmbedHostObject ( "product" , product ) ;
9096 jsEngine . Execute ( updateCode ) ;
9197
9298 output1 = jsEngine . Evaluate < string > ( input1 ) ;
93- output2 = jsEngine . Evaluate < double > ( input2 ) ;
99+ output2 = jsEngine . Evaluate < string > ( input2 ) ;
100+ output3 = jsEngine . Evaluate < double > ( input3 ) ;
94101 }
95102
96103 // Assert
97104 Assert . AreEqual ( targetOutput1 , output1 ) ;
98105 Assert . AreEqual ( targetOutput2 , output2 ) ;
106+ Assert . AreEqual ( targetOutput3 , output3 ) ;
99107 }
100108
101109 #endregion
@@ -218,17 +226,22 @@ public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithPropertiesIsCorr
218226 {
219227 // Arrange
220228 var person = new Person ( "Vanya" , "Ivanov" ) ;
221- const string updateCode = "person.LastName = person.LastName.substr(0, 5) + 'ff';" ;
229+ const string updateCode = @"person.LastName = person.LastName.substr(0, 5) + 'ff';
230+ person.Patronymic = null;" ;
222231
223232 const string input1 = "person.FirstName" ;
224233 const string targetOutput1 = "Vanya" ;
225234
226235 const string input2 = "person.LastName" ;
227236 const string targetOutput2 = "Ivanoff" ;
228237
238+ const string input3 = "person.Patronymic" ;
239+ const string targetOutput3 = null ;
240+
229241 // Act
230242 string output1 ;
231243 string output2 ;
244+ string output3 ;
232245
233246 using ( var jsEngine = CreateJsEngine ( ) )
234247 {
@@ -237,11 +250,13 @@ public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithPropertiesIsCorr
237250
238251 output1 = jsEngine . Evaluate < string > ( input1 ) ;
239252 output2 = jsEngine . Evaluate < string > ( input2 ) ;
253+ output3 = jsEngine . Evaluate < string > ( input3 ) ;
240254 }
241255
242256 // Assert
243257 Assert . AreEqual ( targetOutput1 , output1 ) ;
244258 Assert . AreEqual ( targetOutput2 , output2 ) ;
259+ Assert . AreEqual ( targetOutput3 , output3 ) ;
245260 }
246261
247262 [ Test ]
@@ -405,7 +420,7 @@ public virtual void EmbeddingOfInstanceOfCustomReferenceTypeWithMethodIsCorrect(
405420 var fileManager = new FileManager ( ) ;
406421 string filePath = GetAbsolutePath ( "SharedFiles/link.txt" ) ;
407422
408- string input = string . Format ( "fileManager.ReadFile('{0}')" , filePath . Replace ( @"\" , @"\\" ) ) ;
423+ string input = string . Format ( "fileManager.ReadFile('{0}', null )" , filePath . Replace ( @"\" , @"\\" ) ) ;
409424 const string targetOutput = "http://www.panopticoncentral.net/2015/09/09/the-two-faces-of-jsrt-in-windows-10/" ;
410425
411426 // Act
0 commit comments