2 * Copyright 2000-2016 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.siyeh.ig.fixes.equality;
18 import com.siyeh.InspectionGadgetsBundle;
19 import com.siyeh.ig.IGQuickFixesTestCase;
20 import com.siyeh.ig.equality.EqualityOperatorComparesObjectsInspection;
23 * @see EqualityOperatorComparesObjectsInspection
24 * @author Bas Leijdekkers
26 public abstract class EqualityOperatorComparesObjectsInspectionTestBase extends IGQuickFixesTestCase {
28 public void testEnumComparison() { assertQuickfixNotAvailable(); }
29 public void testNullComparison() { assertQuickfixNotAvailable(); }
30 public void testPrimitiveComparison() { assertQuickfixNotAvailable(); }
31 public void testSimpleObjectComparison() { doTest(true, false); }
32 public void testNegatedObjectComparison() { doTest(false, false); }
35 protected void setUp() throws Exception {
37 myFixture.enableInspections(new EqualityOperatorComparesObjectsInspection());
38 myDefaultHint = "Replace";
39 myRelativePath = "equality/replace_equality_with_equals";
42 protected void doTest(boolean isEqual, boolean isSafe) {
43 doTest(InspectionGadgetsBundle.message(
44 isSafe ? "equality.operator.compares.objects.safe.quickfix" : "equality.operator.compares.objects.quickfix",
45 isEqual ? "==" : "!=",