Android Open Source - Butler Arithmetic Test From Project Back to project page Butler .
License The source code is released under:
Apache License
If you think the Android project Butler listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code package com.bingzer.android;
/ / f r o m w w w . j a v a 2 s . c o m
import android.test.AndroidTestCase;
import static com.bingzer.android.Arithmetic.avg;
import static com.bingzer.android.Arithmetic.sum;
public class ArithmeticTest extends AndroidTestCase {
public void test_sum_ints(){
assertEquals(6, sum(1,2,3));
assertEquals(0, sum());
}
public void test_avg_ints(){
assertEquals(2, avg(1,2,3));
assertEquals(0, avg());
}
public void test_sum_floats(){
assertEquals(6, sum(1f,2f,3f), 0.01);
assertEquals(0, (float ) sum(), 0.01f);
}
public void test_avg_floats(){
assertEquals(2, avg(1f,2f,3f), 0.01);
assertEquals(0, (float ) avg(), 0.01f);
}
public void test_sum_double(){
assertEquals(6, sum(1d,2d,3d), 0.01);
assertEquals(0, sum(), 0.01);
}
public void test_avg_double(){
assertEquals(2, avg(1d,2d,3d), 0.01);
assertEquals(0, avg(), 0.01);
}
}
Java Source Code List com.bingzer.android.AndroidApp.java com.bingzer.android.Anim.java com.bingzer.android.ArithmeticTest.java com.bingzer.android.Arithmetic.java com.bingzer.android.AsyncTest.java com.bingzer.android.Async.java com.bingzer.android.BundleKeys.java com.bingzer.android.CollectorTest.java com.bingzer.android.Collector.java com.bingzer.android.ConstantsTest.java com.bingzer.android.Constants.java com.bingzer.android.Delegate.java com.bingzer.android.DimensionTest.java com.bingzer.android.Dimension.java com.bingzer.android.EmailTest.java com.bingzer.android.Email.java com.bingzer.android.GlobalIntents.java com.bingzer.android.Media.java com.bingzer.android.Modal.java com.bingzer.android.NetTest.java com.bingzer.android.Net.java com.bingzer.android.PackageVerifier.java com.bingzer.android.ParserTest.java com.bingzer.android.Parser.java com.bingzer.android.PathTest.java com.bingzer.android.Path.java com.bingzer.android.RandomiteTest.java com.bingzer.android.Randomite.java com.bingzer.android.Res.java com.bingzer.android.Result.java com.bingzer.android.StringifyTest.java com.bingzer.android.Stringify.java com.bingzer.android.Task.java com.bingzer.android.Threading.java com.bingzer.android.TimespanTest.java com.bingzer.android.Timespan.java com.bingzer.android.ViewUtils.java com.bingzer.android.WebColorTest.java com.bingzer.android.WebColor.java com.bingzer.android.XDocument.java com.bingzer.android.eula.EulaFragment.java com.bingzer.android.eula.OnEulaAgreedTo.java com.bingzer.android.sample.App.java com.bingzer.android.sample.MainActivity.java