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")));
  }
}
@@ -506,17 +506,17 @@
 %D0%B0%D1%82%D0%B0%22, %221
-%C2%A0
+,
 021.00%22,
@@ -527,17 +527,17 @@
 .21%22, %221
-%C2%A0
+,
 010.79%22,
@@ -973,9 +973,9 @@
  %2248
-%C2%A0
+,
 271.

fix test to use , as thousand delimiter