Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

69 lines (56 sloc) 1.149 kb
using System;
using System.Linq;
using System.Numerics;
using Xunit;
namespace FluentCassandra
{
public class BigDecimalTest
{
[Fact]
public void Decimal_Same_In_And_Out()
{
// arrange
var expected = 1000000.00013M;
// act
var bigDec = new BigDecimal(expected);
var actual = (decimal)bigDec;
// assert
Assert.Equal(expected, actual);
}
[Fact]
public void Negative_Decimal_Same_In_And_Out()
{
// arrange
var expected = -1000000.00013M;
// act
var bigDec = new BigDecimal(expected);
var actual = (decimal)bigDec;
// assert
Assert.Equal(expected, actual);
}
[Fact]
public void ToString()
{
// arrange
var dec = 1000000.00013M;
var expected = dec.ToString("G");
// act
var bigDec = new BigDecimal(dec);
var actual = bigDec.ToString();
// assert
Assert.Equal(expected, actual);
}
[Fact]
public void Negative_ToString()
{
// arrange
var dec = -1000000.00013M;
var expected = dec.ToString("G");
// act
var bigDec = new BigDecimal(dec);
var actual = bigDec.ToString();
// assert
Assert.Equal(expected, actual);
}
}
}
Jump to Line
Something went wrong with that request. Please try again.