name:
src/test/java/io/protobase/f7/spreadsheet/GeneralRawValuePassThroughTest.java
-rw-r--r--
1736
1package io.protobase.f7.spreadsheet;
2
3import io.protobase.f7.errors.DivException;
4import io.protobase.f7.errors.NullException;
5import io.protobase.f7.errors.RefException;
6import io.protobase.f7.testutils.TestExecution;
7import org.junit.Test;
8
9public class GeneralRawValuePassThroughTest extends TestExecution {
10 @Test
11 public void test_PassThrough() {
12 runner()
13 .addCell("Alpha", "A1", "1")
14 .addCell("Alpha", "A2", "2")
15 .addCell("Alpha", "A3", "4")
16 .addCell("Alpha", "A4", "8")
17 .addCell("Alpha", "A5", "16")
18 .addCell("Alpha", "A6", "32")
19 .addCell("Alpha", "A7", "= SUM(A1:A6)")
20 .addExpectedValue("Alpha", "A1", "1")
21 .addExpectedValue("Alpha", "A2", "2")
22 .addExpectedValue("Alpha", "A3", "4")
23 .addExpectedValue("Alpha", "A4", "8")
24 .addExpectedValue("Alpha", "A5", "16")
25 .addExpectedValue("Alpha", "A6", "32")
26 .addExpectedValue("Alpha", "A7", 63.0)
27 .run();
28 runner()
29 .addCell("Alpha", "A1", "91287319")
30 .addCell("Alpha", "A2", "Text Value Here")
31 .addCell("Alpha", "A3", "0.1832773e10")
32 .addExpectedValue("Alpha", "A1", "91287319")
33 .addExpectedValue("Alpha", "A2", "Text Value Here")
34 .addExpectedValue("Alpha", "A3", "0.1832773e10")
35 .run();
36 }
37
38 @Test
39 public void test_ErrorAsStringShouldBeCastToError() {
40 runner()
41 .addCell("Alpha", "A1", "#DIV/0!")
42 .addCell("Alpha", "A2", "#NULL!")
43 .addCell("Alpha", "A3", "#REF!")
44 .addExpectedValue("Alpha", "A1", new DivException())
45 .addExpectedValue("Alpha", "A2", new NullException())
46 .addExpectedValue("Alpha", "A3", new RefException())
47 .run();
48 }
49}