public void FindFunction_SearchesInVmLibraries_WhenFoundReturnsReference() { var sut = new VMContext(); var vmLibrary = new TestVmLibrary("foo", "bar", "john"); sut.AddVMLibrary(vmLibrary); var actual = sut.FindExternalFunction("bar"); Assert.Same(vmLibrary.Functions["bar"], actual); }
public void FindFunction_WhenSearchingMethodIsNotFound_ThrowsException() { var sut = new VMContext(); Assert.Throws <InvalidOperationException>(() => sut.FindExternalFunction("notExistingMethod")); }