public void TestAllowTruncationTrue()
{
var options = new RepresentationSerializationOptions(BsonType.Int32, false, true);
Assert.AreEqual((double)long.MaxValue, options.ToDouble(long.MaxValue));
Assert.AreEqual((double)ulong.MaxValue, options.ToDouble(ulong.MaxValue));
Assert.AreEqual((short)1, options.ToInt16((double)1.5));
Assert.AreEqual((int)1, options.ToInt32((double)1.5));
Assert.AreEqual((int)1, options.ToInt32((float)1.5F));
Assert.AreEqual((long)1, options.ToInt64((double)1.5));
Assert.AreEqual((long)1, options.ToInt64((float)1.5F));
Assert.AreEqual((float)0.0F, options.ToSingle(double.Epsilon));
Assert.AreEqual((ushort)1, options.ToUInt16((double)1.5));
Assert.AreEqual((uint)1, options.ToUInt32((double)1.5));
Assert.AreEqual((ulong)1, options.ToUInt64((double)1.5));
}