@@ -0,0 +1,2962 @@
+/*%0A * Copyright 2015 Adam Speakman%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage speakman.whatsshakingnz.ui.viewmodel;%0A%0Aimport android.test.AndroidTestCase;%0A%0Aimport speakman.whatsshakingnz.model.Earthquake;%0A%0A/**%0A * Created by Adam on 12/2/2015.%0A */%0Apublic class EarthquakeDetailViewModelTests extends AndroidTestCase %7B%0A%0A    private static class TestEarthquake implements Earthquake %7B%0A%0A        @Override%0A        public long getOriginTime() %7B%0A            return 0;%0A        %7D%0A%0A        @Override%0A        public long getUpdatedTime() %7B%0A            return 0;%0A        %7D%0A%0A        @Override%0A        public double getLatitude() %7B%0A            return 0;%0A        %7D%0A%0A        @Override%0A        public double getLongitude() %7B%0A            return 0;%0A        %7D%0A%0A        @Override%0A        public double getMagnitude() %7B%0A            return 0;%0A        %7D%0A%0A        @Override%0A        public double getDepth() %7B%0A            return 0;%0A        %7D%0A%0A        @Override%0A        public String getId() %7B%0A            return null;%0A        %7D%0A    %7D%0A%0A    public void testRoundedUpMagnitudeIsReturned() %7B%0A        Earthquake roundUpEarthquake = new TestEarthquake() %7B%0A            @Override%0A            public double getMagnitude() %7B%0A                return 5.35093;%0A            %7D%0A        %7D;%0A%0A        EarthquakeDetailViewModel roundUpViewModel = new EarthquakeDetailViewModel(roundUpEarthquake);%0A        assertEquals(%225.4%22, roundUpViewModel.getMagnitude());%0A    %7D%0A%0A    public void testRoundedDownMagnitudeIsReturned() %7B%0A        Earthquake roundDownEarthquake = new TestEarthquake() %7B%0A            @Override%0A            public double getMagnitude() %7B%0A                return 5.34567;%0A            %7D%0A        %7D;%0A%0A        EarthquakeDetailViewModel roundDownViewModel = new EarthquakeDetailViewModel(roundDownEarthquake);%0A        assertEquals(%225.3%22, roundDownViewModel.getMagnitude());%0A    %7D%0A%0A    public void testNorthOfAucklandIsReturned() %7B%0A        Earthquake northEarthquake = new TestEarthquake() %7B%0A            @Override%0A            public double getLatitude() %7B%0A                return -36.762916;%0A            %7D%0A%0A            @Override%0A            public double getLongitude() %7B%0A                return 174.815451;%0A            %7D%0A        %7D;%0A%0A        EarthquakeDetailViewModel northViewModel = new EarthquakeDetailViewModel(northEarthquake);%0A        assertTrue(northViewModel.getLocation().contains(%22North%22));%0A        assertTrue(northViewModel.getLocation().contains(%22Auckland%22));%0A    %7D%0A%7D%0A

Add EarthquakeDetailViewModelTests