Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion test/JavaScriptEngineSwitcher.Tests/ChakraCore/InteropTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
namespace JavaScriptEngineSwitcher.Tests.ChakraCore
using System;
using Xunit;

namespace JavaScriptEngineSwitcher.Tests.ChakraCore
{
public class InteropTests : InteropTestsBase
{
protected override string EngineName
{
get { return "ChakraCoreJsEngine"; }
}

[Fact]
public void EmbeddedInstanceOfDelegateHasFunctionPrototype()
{
// Arrange
var someFunc = new Func<int>(() => 42);

const string input = "Object.getPrototypeOf(embeddedFunc) === Function.prototype";

// Act
bool output;

using (var jsEngine = CreateJsEngine())
{
jsEngine.EmbedHostObject("embeddedFunc", someFunc);
output = jsEngine.Evaluate<bool>(input);
}

// Assert
Assert.True(output);
}
}
}