// Path: mangopay/src/main/java/com/mangopay/android/sdk/model/exception/MangoException.java
// public class MangoException extends RuntimeException {
// 
//   private String id;
//   private String type;
//   private long timestamp;
// 
//   public MangoException(Throwable throwable) {
//     super(throwable);
//     this.id = ErrorCode.SDK_ERROR.getValue();
//     this.timestamp = System.currentTimeMillis();
//   }
// 
//   public MangoException(String id, String message) {
//     this(id, message, null);
//   }
// 
//   public MangoException(String id, String message, String type) {
//     super(message);
//     this.id = id;
//     this.type = type;
//     this.timestamp = System.currentTimeMillis();
//   }
// 
//   public String getId() {
//     return id;
//   }
// 
//   public void setId(String id) {
//     this.id = id;
//   }
// 
//   public String getType() {
//     return type;
//   }
// 
//   public void setType(String type) {
//     this.type = type;
//   }
// 
//   public long getTimestamp() {
//     return timestamp;
//   }
// 
//   public void setTimestamp(long timestamp) {
//     this.timestamp = timestamp;
//   }
// 
//   @Override public boolean equals(Object o) {
//     if (this == o) return true;
//     if (o == null || getClass() != o.getClass()) return false;
// 
//     MangoException error = (MangoException) o;
// 
//     return !(id != null ? !id.equals(error.id) : error.id != null);
// 
//   }
// 
//   @Override public int hashCode() {
//     return id != null ? id.hashCode() : 0;
//   }
// 
//   @Override public String toString() {
//     return "MangoError{" +
//             "id='" + id + '\'' +
//             ", message='" + getMessage() + '\'' +
//             ", type='" + type + '\'' +
//             ", timestamp=" + timestamp +
//             '}';
//   }
// }


import com.mangopay.android.sdk.model.exception.MangoException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
package com.mangopay.android.sdk.model;




@RunWith(MockitoJUnitRunner.class)
public class MangoCardTest {

  private static final String CARD_NUMBER = "3569990000000157";
  private static final String CARD_EXPIRATION_DATE = "0920";
  private static final String CARD_CVX = "123";
  private static final String INVALID = "";

  @Test
  public void shouldBeValidatedOk() {
    MangoCard card = new MangoCard(CARD_NUMBER, CARD_EXPIRATION_DATE, CARD_CVX);

    card.validate();

    assertNotNull(card);
    assertEquals(CARD_NUMBER, card.getCardNumber());
    assertEquals(CARD_EXPIRATION_DATE, card.getExpirationDate());
    assertEquals(CARD_CVX, card.getCvx());
  }

// Path: mangopay/src/main/java/com/mangopay/android/sdk/model/exception/MangoException.java
// public class MangoException extends RuntimeException {
// 
//   private String id;
//   private String type;
//   private long timestamp;
// 
//   public MangoException(Throwable throwable) {
//     super(throwable);
//     this.id = ErrorCode.SDK_ERROR.getValue();
//     this.timestamp = System.currentTimeMillis();
//   }
// 
//   public MangoException(String id, String message) {
//     this(id, message, null);
//   }
// 
//   public MangoException(String id, String message, String type) {
//     super(message);
//     this.id = id;
//     this.type = type;
//     this.timestamp = System.currentTimeMillis();
//   }
// 
//   public String getId() {
//     return id;
//   }
// 
//   public void setId(String id) {
//     this.id = id;
//   }
// 
//   public String getType() {
//     return type;
//   }
// 
//   public void setType(String type) {
//     this.type = type;
//   }
// 
//   public long getTimestamp() {
//     return timestamp;
//   }
// 
//   public void setTimestamp(long timestamp) {
//     this.timestamp = timestamp;
//   }
// 
//   @Override public boolean equals(Object o) {
//     if (this == o) return true;
//     if (o == null || getClass() != o.getClass()) return false;
// 
//     MangoException error = (MangoException) o;
// 
//     return !(id != null ? !id.equals(error.id) : error.id != null);
// 
//   }
// 
//   @Override public int hashCode() {
//     return id != null ? id.hashCode() : 0;
//   }
// 
//   @Override public String toString() {
//     return "MangoError{" +
//             "id='" + id + '\'' +
//             ", message='" + getMessage() + '\'' +
//             ", type='" + type + '\'' +
//             ", timestamp=" + timestamp +
//             '}';
//   }
// }


// Path: mangopay/src/test/java/com.mangopay.android.sdk/model/MangoCardTest.java
import com.mangopay.android.sdk.model.exception.MangoException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

package com.mangopay.android.sdk.model;




@RunWith(MockitoJUnitRunner.class)
public class MangoCardTest {

  private static final String CARD_NUMBER = "3569990000000157";
  private static final String CARD_EXPIRATION_DATE = "0920";
  private static final String CARD_CVX = "123";
  private static final String INVALID = "";

  @Test
  public void shouldBeValidatedOk() {
    MangoCard card = new MangoCard(CARD_NUMBER, CARD_EXPIRATION_DATE, CARD_CVX);

    card.validate();

    assertNotNull(card);
    assertEquals(CARD_NUMBER, card.getCardNumber());
    assertEquals(CARD_EXPIRATION_DATE, card.getExpirationDate());
    assertEquals(CARD_CVX, card.getCvx());
  }

  @Test(expected = MangoException.class)