<commit_before>/**
 * Copyright (C) 2009 - 2010 by OpenGamma Inc.
 *
 * Please see distribution for license.
 */
package com.opengamma.engine.view;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.math.BigDecimal;

import org.junit.Test;

/**
 * Test NumberDeltaComparer.
 *
 * @author jonathan
 */
public class NumberDeltaComparerTest {
  
  @Test
  public void testDoubleFourDecimalPlaces() {
    NumberDeltaComparer ndc = new NumberDeltaComparer(4);<commit_msg>Test null conditions.<commit_after>/**
 * Copyright (C) 2009 - 2010 by OpenGamma Inc.
 *
 * Please see distribution for license.
 */
package com.opengamma.engine.view;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.math.BigDecimal;

import org.junit.Test;

/**
 * Test NumberDeltaComparer.
 *
 * @author jonathan
 */
public class NumberDeltaComparerTest {
  
  @Test
  public void bothNulls() {
    NumberDeltaComparer ndc = new NumberDeltaComparer(4);
    assertFalse(ndc.isDelta(null, null));
  }
  
  @Test
  public void oneNulls() {
    NumberDeltaComparer ndc = new NumberDeltaComparer(4);
    assertTrue(ndc.isDelta(null, 1.5));
    assertTrue(ndc.isDelta(1.5, null));
  }
  
  @Test
  public void testDoubleFourDecimalPlaces() {
    NumberDeltaComparer ndc = new NumberDeltaComparer(4);
{'fraction_non_alphanumeric': 0.10858400586940573, 'fraction_numerical': 0.01760821716801174, 'mean_word_length': 4.108614232209738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5628857', 'n_tokens_mistral': 451, 'n_tokens_neox': 435, 'n_words': 103}