// Path: src/main/java/com/qoomon/banking/swift/message/block/exception/BlockFieldParseException.java
// public class BlockFieldParseException extends Exception {
// 
// 
//     public BlockFieldParseException(String message) {
//         super(message);
//     }
// 
// 
//     public BlockFieldParseException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
// }


import com.qoomon.banking.swift.message.block.exception.BlockFieldParseException;
import org.junit.Test;
import static org.assertj.core.api.Assertions.*;
import static org.assertj.core.api.ThrowableAssert.catchThrowable;
package com.qoomon.banking.swift.message.block;



/**
 * Created by qoomon on 07/07/16.
 */
public class TextBlockTest {

    @Test
    public void of_WHEN_valid_block_with_info_line_is_passed_RETURN_new_block() throws Exception {

        // Given
        GeneralBlock generalBlock = new GeneralBlock(TextBlock.BLOCK_ID_4, "info\nabc\n-");

        // When
        TextBlock block = TextBlock.of(generalBlock);

        // Then
        assertThat(block).isNotNull();
        assertThat(block.getInfoLine()).hasValue("info");
        assertThat(block.getText()).isEqualTo("abc\n-");
    }

// Path: src/main/java/com/qoomon/banking/swift/message/block/exception/BlockFieldParseException.java
// public class BlockFieldParseException extends Exception {
// 
// 
//     public BlockFieldParseException(String message) {
//         super(message);
//     }
// 
// 
//     public BlockFieldParseException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
// }


// Path: src/test/java/com/qoomon/banking/swift/message/block/TextBlockTest.java
import com.qoomon.banking.swift.message.block.exception.BlockFieldParseException;
import org.junit.Test;
import static org.assertj.core.api.Assertions.*;
import static org.assertj.core.api.ThrowableAssert.catchThrowable;

package com.qoomon.banking.swift.message.block;



/**
 * Created by qoomon on 07/07/16.
 */
public class TextBlockTest {

    @Test
    public void of_WHEN_valid_block_with_info_line_is_passed_RETURN_new_block() throws Exception {

        // Given
        GeneralBlock generalBlock = new GeneralBlock(TextBlock.BLOCK_ID_4, "info\nabc\n-");

        // When
        TextBlock block = TextBlock.of(generalBlock);

        // Then
        assertThat(block).isNotNull();
        assertThat(block.getInfoLine()).hasValue("info");
        assertThat(block.getText()).isEqualTo("abc\n-");
    }

    @Test