package com.jexpect;

import org.junit.Test;

import static com.jexpect.Expect.expect;
import static com.jexpect.util.DataRepository.EMPTY_STRING;
import static com.jexpect.util.DataRepository.NULL_STRING;
import static org.junit.Assert.assertNotNull;

public class ToBeStringTest {

  @Test
  public void To_Be_String() throws Exception {
    expect("must").toBe("must");
  }

  @Test(expected = IllegalArgumentException.class)
  public void To_Be_String_Should_Fail() throws Exception {
    expect("must").toBe("mattias");
  }

  @Test(expected = IllegalArgumentException.class)
  public void To_Be_String_With_Expected_Null_Should_Fail() throws Exception {
    expect("must").toBe(null);
  }

  @Test(expected = IllegalArgumentException.class)
  public void To_Be_String_With_Actual_Null() throws Exception {
    expect(NULL_STRING).toBe("mattias");
  }

  @Test
  public void To_Be_Null() throws Exception {
    expect(NULL_STRING).toBeNull();
  }

  @Test(expected = IllegalArgumentException.class)
  public void Expected_Empty_String_To_Be_Null_Should_Fail() throws Exception {
    expect(EMPTY_STRING).toBeNull();
  }

  @Test(expected = IllegalArgumentException.class)
  public void Expect_Null_To_Be_Empty_Should_Fail() throws Exception {
    expect(NULL_STRING).toBeEmpty();
  }

  @Test
  public void Expect_Empty_To_Be_Empty() throws Exception {
    expect(EMPTY_STRING).toBeEmpty();
  }

  @Test(expected = IllegalArgumentException.class)
  public void Expect_Nonempty_To_Be_Empty_Should_Fail() throws Exception {
    expect("s").toBeEmpty();
  }

  @Test
  public void Expect_Not_To_Be_Empty() throws Exception {
    expect("s").not().toBeEmpty();
  }

  @Test(expected = IllegalArgumentException.class)
  public void Expect_Empty_Not_To_Be_Empty_Should_Fail() throws Exception {
    expect(EMPTY_STRING).not().toBeEmpty();
  }

  @Test
  public void Expect_Actual_To_Not_Be_As_Expected() throws Exception {
    expect("a").not().toBe("b");
  }

  @Test(expected = IllegalArgumentException.class)
  public void Expect_Actual_To_Not_Be_As_Expected_Should_Fail_When_They_Are_Same() throws Exception {
    expect("a").not().toBe("a");
  }

  @Test
  public void Expect_Actual_As_Null_To_Not_Be_As_Expected() throws Exception {
    expect(NULL_STRING).not().toBe("a");
  }

  @Test
  public void Expect_Actual_To_Not_Be_Null() throws Exception {
    expect("a").not().toBe(null);
  }

  @Test(expected = IllegalArgumentException.class)
  public void Expect_Null_To_Be_Null_Should_Fail() throws Exception {
    expect(NULL_STRING).toBe(null);
  }

  @Test
  public void Given_Any_String_Then_Consecutive_Expect_Not_Not_Functions_Should_Not_Be_Null() throws Exception {
    assertNotNull(expect("foo").not().not());
  }
}

@@ -303,72 +303,482 @@
 oid 
-To_Be_String() throws Exception %7B%0A    expect(%22must%22).toBe(%22must%22
+Expect_Should_Not_Throw_Exception() throws Exception %7B%0A    expect(NULL_STRING).toBeNull();%0A    expect(EMPTY_STRING).toBeEmpty();%0A    expect(NULL_STRING).not().toBe(%22a%22);%0A    expect(%22must%22).toBe(%22must%22);%0A    expect(%22s%22).not().toBeEmpty();%0A    expect(%22a%22).not().toBe(%22b%22);%0A    expect(%22a%22).not().toBe(null);%0A  %7D%0A%0A  @Test%0A  public void Given_Any_String_Then_Consecutive_Expect_Not_Not_Functions_Should_Not_Be_Null() throws Exception %7B%0A    assertNotNull(expect(%22foo%22).not().not()
 );%0A 
@@ -1265,103 +1265,8 @@
  %7D%0A%0A
-  @Test%0A  public void To_Be_Null() throws Exception %7B%0A    expect(NULL_STRING).toBeNull();%0A  %7D%0A%0A
   @T
@@ -1602,119 +1602,8 @@
  %7D%0A%0A
-  @Test%0A  public void Expect_Empty_To_Be_Empty() throws Exception %7B%0A    expect(EMPTY_STRING).toBeEmpty();%0A  %7D%0A%0A
   @T
@@ -1762,114 +1762,8 @@
  %7D%0A%0A
-  @Test%0A  public void Expect_Not_To_Be_Empty() throws Exception %7B%0A    expect(%22s%22).not().toBeEmpty();%0A  %7D%0A%0A
   @T
@@ -1938,125 +1938,8 @@
  %7D%0A%0A
-  @Test%0A  public void Expect_Actual_To_Not_Be_As_Expected() throws Exception %7B%0A    expect(%22a%22).not().toBe(%22b%22);%0A  %7D%0A%0A
   @T
@@ -2136,571 +2136,155 @@
 Test
-%0A  public void Expect_Actual_As_Null_To_Not_Be_As_Expected() throws Exception %7B%0A    expect(NULL_STRING).not().toBe(%22a%22);%0A  %7D%0A%0A  @Test%0A  public void Expect_Actual_To_Not_Be_Null() throws Exception %7B%0A    expect(%22a%22).not().toBe(null);%0A  %7D%0A%0A  @Test(expected = IllegalArgumentException.class)%0A  public void Expect_Null_To_Be_Null_Should_Fail() throws Exception %7B%0A    expect(NULL_STRING).toBe(null);%0A  %7D%0A%0A  @Test%0A  public void Given_Any_String_Then_Consecutive_Expect_Not_Not_Functions_Should_Not_Be_Null() throws Exception %7B%0A    assertNotNull(expect(%22foo%22).not().not()
+(expected = IllegalArgumentException.class)%0A  public void Expect_Null_To_Be_Null_Should_Fail() throws Exception %7B%0A    expect(NULL_STRING).toBe(null
 );%0A 

Move logical asserts to single test method instead of having separate for each.