Explorar o código

Fixing unit test

Sebastien Ros %!s(int64=7) %!d(string=hai) anos
pai
achega
630dcf83cf
Modificáronse 2 ficheiros con 8 adicións e 3 borrados
  1. 3 3
      Jint.Tests/Runtime/EngineTests.cs
  2. 5 0
      Jint/Native/JsString.cs

+ 3 - 3
Jint.Tests/Runtime/EngineTests.cs

@@ -1972,7 +1972,7 @@ namespace Jint.Tests.Runtime
 
             Assert.True(result);
         }
-        
+
         [Fact]
         public void ShouldNotCompareClrInstancesWithObjects()
         {
@@ -2468,8 +2468,8 @@ namespace Jint.Tests.Runtime
             var actualValue = engine.Execute(actual).GetCompletionValue().ToObject();
             Assert.Equal(expectedValue, actualValue);
         }
-	
-	[Fact]
+
+        [Fact]
         public void ShouldReturnCorrectConcatenatedStrings()
         {
             RunTest(@"

+ 5 - 0
Jint/Native/JsString.cs

@@ -171,6 +171,11 @@ namespace Jint.Native
                     || _stringBuilder != null && _stringBuilder.Length == 0;
             }
 
+            public override object ToObject()
+            {
+                return _stringBuilder.ToString();
+            }
+
             public override bool Equals(JsValue other)
             {
                 if (other is ConcatenatedString cs)