EMMA Coverage Report (generated Sat Aug 24 21:47:39 PDT 2013)
[all classes][com.example.aatg.tc]

COVERAGE SUMMARY FOR SOURCE FILE [TemperatureConverter.java]

nameclass, %method, %block, %line, %
TemperatureConverter.java100% (2/2)57%  (4/7)78%  (85/109)82%  (9/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TemperatureConverter$OP100% (1/1)50%  (2/4)58%  (29/50)50%  (1/2)
valueOf (String): TemperatureConverter$OP 0%   (0/1)0%   (0/5)0%   (0/1)
values (): TemperatureConverter$OP [] 0%   (0/1)0%   (0/16)0%   (0/1)
<static initializer> 100% (1/1)100% (24/24)100% (1/1)
TemperatureConverter$OP (String, int): void 100% (1/1)100% (5/5)100% (1/1)
     
class TemperatureConverter100% (1/1)67%  (2/3)95%  (56/59)89%  (8/9)
TemperatureConverter (): void 0%   (0/1)0%   (0/3)0%   (0/1)
celsiusToFahrenheit (double): double 100% (1/1)100% (28/28)100% (4/4)
fahrenheitToCelsius (double): double 100% (1/1)100% (28/28)100% (4/4)

1/**
2 * Copyright (C) 2010-2011 Diego Torres Milano
3 */
4package com.example.aatg.tc;
5 
6/**
7 * The Temperature Converter.
8 * 
9 * @author diego
10 *
11 */
12public class TemperatureConverter /*implements Converter*/ {
13        
14        public static final double ABSOLUTE_ZERO_C = -273.15d;
15        public static final double ABSOLUTE_ZERO_F = -459.67d;
16        
17        public static final String ERROR_MESSAGE_BELOW_ZERO_FMT =
18            "Invalid temperature: %.2f%c below absolute zero";
19        
20        /**
21         * C2F: celsiusToFahrenheit
22         * F2C: fahrenheitToCelsius
23         */
24        public static enum OP { C2F, F2C };
25        
26        public static double fahrenheitToCelsius(double f) {
27                if (f < ABSOLUTE_ZERO_F) {
28                    throw new InvalidTemperatureException(
29                         String.format(ERROR_MESSAGE_BELOW_ZERO_FMT, f, 'F'));
30                }
31                return ((f - 32) / 1.8d);
32        }
33 
34        public static double celsiusToFahrenheit(double c) {
35                if (c < ABSOLUTE_ZERO_C) {
36                        throw new InvalidTemperatureException(
37                                        String.format(ERROR_MESSAGE_BELOW_ZERO_FMT, c, 'C'));
38                }
39                return (c * 1.8d + 32);
40        }
41        
42}

[all classes][com.example.aatg.tc]
EMMA 2.0.5312 (C) Vladimir Roubtsov