f7
f7 is a spreadsheet formula execution library
git clone https://git.vogt.world/f7.git
Log | Files | README.md | LICENSE.md
← All files
name: src/test/java/io/protobase/f7/spreadsheet/F7CodeExecutorGeneralErrorTest.java
-rw-r--r--
1984
 1package io.protobase.f7.spreadsheet;
 2
 3import io.protobase.f7.errors.DivException;
 4import io.protobase.f7.errors.NAException;
 5import io.protobase.f7.errors.NameException;
 6import io.protobase.f7.errors.NullException;
 7import io.protobase.f7.errors.NumException;
 8import io.protobase.f7.errors.ParseException;
 9import io.protobase.f7.errors.RefException;
10import io.protobase.f7.errors.ValueException;
11import io.protobase.f7.testutils.TestF7CodeExecutor;
12import org.junit.Test;
13
14import static com.google.common.truth.Truth.assertThat;
15
16public class F7CodeExecutorGeneralErrorTest extends TestF7CodeExecutor {
17  @Test
18  public void test_NullError() {
19    assertThat(run("= #NULL!")).isEqualTo(new NullException());
20    assertThat(run("= #null!")).isEqualTo(new NullException());
21  }
22
23  @Test
24  public void test_DivError() {
25    assertThat(run("= #DIV/0!")).isEqualTo(new DivException());
26    assertThat(run("= #div/0!")).isEqualTo(new DivException());
27  }
28
29  @Test
30  public void test_ValueError() {
31    assertThat(run("= #VALUE!")).isEqualTo(new ValueException());
32    assertThat(run("= #value!")).isEqualTo(new ValueException());
33  }
34
35  @Test
36  public void test_RefError() {
37    assertThat(run("= #REF!")).isEqualTo(new RefException());
38    assertThat(run("= #ref!")).isEqualTo(new RefException());
39  }
40
41  @Test
42  public void test_NameError() {
43    assertThat(run("= #NAME?")).isEqualTo(new NameException());
44    assertThat(run("= #name?")).isEqualTo(new NameException());
45  }
46
47  @Test
48  public void test_NumError() {
49    assertThat(run("= #NUM!")).isEqualTo(new NumException());
50    assertThat(run("= #num!")).isEqualTo(new NumException());
51  }
52
53  @Test
54  public void test_NAError() {
55    assertThat(run("= #N/A")).isEqualTo(new NAException());
56    assertThat(run("= #n/a")).isEqualTo(new NAException());
57  }
58
59  @Test
60  public void test_ParseError() {
61    assertThat(run("= #ERROR!")).isEqualTo(new ParseException());
62    assertThat(run("= #error!")).isEqualTo(new ParseException());
63  }
64}