示例#1
0
        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);
        }
示例#2
0
        public void FindFunction_WhenSearchingMethodIsNotFound_ThrowsException()
        {
            var sut = new VMContext();

            Assert.Throws <InvalidOperationException>(() => sut.FindExternalFunction("notExistingMethod"));
        }