package com.codeborne.xlstest.matchers;

import com.codeborne.xlstest.XLS;
import org.junit.Test;

import static com.codeborne.xlstest.XLS.containsRow;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;

public class ContainsRowTest {
  @Test
  public void rowContainsCells_all() {
    XLS xls = new XLS(getClass().getClassLoader().getResource("acquiring.xls"));
    assertThat(xls, containsRow("PP028000", "дом 261Б, ул Семафорная, г Красноярск, 197372, РОССИЯ", "Оплата", "1 021,00", "10,21", "1 010,79", "27.05.2015 00:00:00", "415039******2364", "476956", "281814930"));
  }

  @Test
  public void rowContainsCells_withGaps() throws Exception {
    XLS xls = new XLS(getClass().getClassLoader().getResource("acquiring.xls"));
    assertThat(xls, containsRow("PP028000"));
    assertThat(xls, containsRow("PP028000", "281814930"));
    assertThat(xls, containsRow("281814930"));
    assertThat(xls, containsRow("Итого по терминалу", "48 271,00"));
  }

  @Test
  public void rowContainsCells_noMatch() {
    XLS xls = new XLS(getClass().getClassLoader().getResource("acquiring.xls"));
    assertThat(xls, not(containsRow("foobar")));
    assertThat(xls, not(containsRow("foobar", "PP028000", "281814930")));
    assertThat(xls, not(containsRow("PP028000", "281814930", "foobar")));
    assertThat(xls, not(containsRow("PP028000", "foobar", "281814930")));
  }
}
@@ -514,17 +514,17 @@
 %C2%A0021
-,
+.
 00%22, %2210
 ,21%22
@@ -519,17 +519,17 @@
 00%22, %2210
-,
+.
 21%22, %221%C2%A0
@@ -531,17 +531,17 @@
 , %221%C2%A0010
-,
+.
 79%22, %2227
@@ -973,17 +973,17 @@
  %2248%C2%A0271
-,
+.
 00%22));%0A 

fix test to use . as floating point delimiter