From 415a36a90d8d5683135eefc567e107ee0ac46985 Mon Sep 17 00:00:00 2001 From: Jonathan Thoene Date: Tue, 6 Aug 2019 10:12:22 +0200 Subject: [PATCH] Initial working quickfix test infrastructure --- .../tests/SolidityQuickfixTests.xtend | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 plugins/com.yakindu.solidity.tests/src/com/yakindu/solidity/tests/SolidityQuickfixTests.xtend diff --git a/plugins/com.yakindu.solidity.tests/src/com/yakindu/solidity/tests/SolidityQuickfixTests.xtend b/plugins/com.yakindu.solidity.tests/src/com/yakindu/solidity/tests/SolidityQuickfixTests.xtend deleted file mode 100644 index c3b8629c..00000000 --- a/plugins/com.yakindu.solidity.tests/src/com/yakindu/solidity/tests/SolidityQuickfixTests.xtend +++ /dev/null @@ -1,67 +0,0 @@ -package com.yakindu.solidity.tests - -import org.eclipse.xtext.ui.testing.AbstractQuickfixTest -import org.junit.Before -import org.junit.Test - -import static com.yakindu.solidity.validation.IssueCodes.* -import org.junit.runner.RunWith -import org.eclipse.xtext.testing.XtextRunner -import org.eclipse.xtext.testing.InjectWith - -@RunWith(XtextRunner) -@InjectWith(SolidityInjectorProvider) -class SolidityQuickfixTests extends AbstractQuickfixTest { - - @Before - def void setup() { - } - - @Test - def void fixNotSolidityDefaultVersion() { - var modelToFix = ''' - pragma solidity ^0.5.9; - - contract MyContract { - address creator; - - constructor() public{ - creator = msg.sender; - } - - // TODO Add functions - - function kill() public { - if (msg.sender == creator) { - selfdestruct(creator); - } - } - } - ''' - - var expectedResult = ''' - pragma solidity ^0.5.9; - - contract MyContract { - address payable creator; - - constructor() public{ - creator = msg.sender; - } - - // TODO Add functions - - function kill() public { - if (msg.sender == creator) { - selfdestruct(creator); - } - } - } - ''' - testQuickfixesOn( - modelToFix, - ERROR_INVALID_IMPLICID_CONVERSION_TO_ADDRESS_PAYABLE, - new Quickfix("Add payable to declaration", "Add payable to declaration", expectedResult) - ) - } -}