Browse Source

Adding a couple unit tests

Sebastien Ros 11 years ago
parent
commit
20048cb8c2
2 changed files with 20 additions and 3 deletions
  1. 5 0
      Jint.Tests/Runtime/Domain/A.cs
  2. 15 3
      Jint.Tests/Runtime/InteropTests.cs

+ 5 - 0
Jint.Tests/Runtime/Domain/A.cs

@@ -85,5 +85,10 @@ namespace Jint.Tests.Runtime.Domain
         {
         {
             return String.Format("{0}:{1}", firstParam, String.Join(",", values));
             return String.Format("{0}:{1}", firstParam, String.Join(",", values));
         }
         }
+
+        public void Call15(string x)
+        {
+
+        }
     }
     }
 }
 }

+ 15 - 3
Jint.Tests/Runtime/InteropTests.cs

@@ -1083,21 +1083,33 @@ namespace Jint.Tests.Runtime
                 assert(x === null);
                 assert(x === null);
             ");
             ");
         }
         }
-        
+
         [Fact]
         [Fact]
         public void ShouldSetPropertyToNull()
         public void ShouldSetPropertyToNull()
         {
         {
             var p = new Person { Name = "Mickey" };
             var p = new Person { Name = "Mickey" };
             _engine.SetValue("p", p);
             _engine.SetValue("p", p);
-            
+
             RunTest(@"
             RunTest(@"
                 assert(p.Name != null);
                 assert(p.Name != null);
                 p.Name = null;
                 p.Name = null;
                 assert(p.Name == null);
                 assert(p.Name == null);
             ");
             ");
-            
+
             Assert.True(p.Name == null);
             Assert.True(p.Name == null);
         }
         }
 
 
+        [Fact]
+        public void ShouldCallMethodWithNull()
+        {
+            _engine.SetValue("a", new A());
+
+            RunTest(@"
+                a.Call15(null);
+                var result = a.Call2(null);
+                assert(result == null);
+            ");
+        }
+
     }
     }
 }
 }