public void PrepareScriptShouldThrowExceptionIfCompilerMethodFails() { var compiler = Mock.Create<INodeVisitor>(); var executer = new CSharpExpressionNodeExecuter(compiler); Mock.Arrange(() => compiler.PrepareScript(Arg.IsAny<DestinationNode>(), Arg.IsAny<Dictionary<string, string>>())).Throws<Exception>(); executer.PrepareScript(null, null); }
public void PrepareScriptShouldCallCompilerMethod() { var compiler = Mock.Create<INodeVisitor>(); var executer = new CSharpExpressionNodeExecuter(compiler); executer.PrepareScript(null, null); Mock.Assert(() => compiler.PrepareScript(Arg.IsAny<DestinationNode>(), Arg.IsAny<Dictionary<string, string>>()), Occurs.Once()); }