/eclipse-plugin/com.google.test.metric.eclipse.ui.test/src/main/java/com/google/test/metric/eclipse/internal/util/TestabilityExplorerMessageRetrieverTest.java
Java | 47 lines | 22 code | 5 blank | 20 comment | 0 complexity | 7f15b4adbb6beaa173f91039174982c9 MD5 | raw file
1/* 2 * Copyright 2009 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * the License. 15 */ 16package com.google.test.metric.eclipse.internal.util; 17 18import com.google.test.metric.report.issues.IssueSubType; 19import com.google.test.metric.report.issues.IssueType; 20 21import junit.framework.TestCase; 22 23/** 24 * Tests for {@link TestabilityExplorerMessageRetriever} 25 * 26 * @author shyamseshadri@google.com (Shyam Seshadri) 27 */ 28public class TestabilityExplorerMessageRetrieverTest extends TestCase { 29 TestabilityExplorerMessageRetriever retriever = new TestabilityExplorerMessageRetriever(); 30 31 public void testConvertTypeSubTypeToString() throws Exception { 32 assertEquals("construction.static_init", 33 retriever.convertTypeSubTypeToString(IssueType.CONSTRUCTION, IssueSubType.STATIC_INIT)); 34 assertEquals("construction.setter", 35 retriever.convertTypeSubTypeToString(IssueType.CONSTRUCTION, IssueSubType.SETTER)); 36 assertEquals("collaborator.non_mockable", 37 retriever.convertTypeSubTypeToString(IssueType.COLLABORATOR, IssueSubType.NON_MOCKABLE)); 38 assertEquals("directcost.complexity", 39 retriever.convertTypeSubTypeToString(IssueType.DIRECT_COST, IssueSubType.COMPLEXITY)); 40 } 41 42 public void testGetSuggestion() throws Exception { 43 assertEquals("Suggestion: refactor the method by breaking the complex portions into several" 44 + " smaller methods.", 45 retriever.getSuggestion(IssueType.DIRECT_COST, IssueSubType.COMPLEXITY)); 46 } 47}