public override object ConvertFrom( ITypeDescriptorContext context, CultureInfo culture, object value) { return(UMoney.Parse((string)value)); }
public UMoneyFormatterTests() { _expectedDeserializedValue = UMoney.Parse("42.0"); _expectedSerializedValue = new byte[] { 146, 196, 2, 164, 1, 1 }; _formatterResolver = new TestFormatterResolver(); _formatterResolver .SetFormatter(new UMoneyFormatter()); }
public bool Test_hash_code_equation(string a, string b) { var aParts = a.Split(':'); var bParts = b.Split(':'); var aFee = new Fee(new Asset(aParts[0]), UMoney.Parse(aParts[1])); var bFee = new Fee(new Asset(bParts[0]), UMoney.Parse(bParts[1])); return(aFee.GetHashCode() == bFee.GetHashCode()); }
public int Test_comparison(string a, string b) { var aParts = a.Split(':'); var bParts = b.Split(':'); var aFee = new Fee(new Asset(aParts[0]), UMoney.Parse(aParts[1])); var bFee = new Fee(new Asset(bParts[0]), UMoney.Parse(bParts[1])); return(aFee.CompareTo(bFee)); }
public bool Test_equation(string a, string b) { var aParts = a.Split(':'); var bParts = b.Split(':'); var aFee = new Fee(new Asset(aParts[0]), UMoney.Parse(aParts[1])); var bFee = new Fee(new Asset(bParts[0]), UMoney.Parse(bParts[1])); return(Equals(aFee, bFee)); }