public void ConversionBreadth() { decimal result; decimal amount; BaseCurrency fromCur; BaseCurrency toCur; amount = 100.0M; fromCur = new PENCurrency(); toCur = new PENCurrency(); result = ConvertibleCurrency.CurrencyConvert(amount, fromCur, toCur); Assert.AreEqual(100.0M, result, "....."); }
public void ConversionBreadth() { decimal result; decimal amount; BaseCurrency fromCur; BaseCurrency toCur; amount = 100.0M; fromCur = new USDCurrency(); toCur = new USDCurrency(); result = ConvertibleCurrency.CurrencyConvert(amount, fromCur, toCur); Assert.AreEqual(100.0M, result, "USD to USD should be no change"); fromCur = new PENCurrency(); toCur = new PENCurrency(); result = ConvertibleCurrency.CurrencyConvert(amount, fromCur, toCur); Assert.AreEqual(100.0M, result, "PEN to PEN should be no change"); fromCur = new EURCurrency(); toCur = new EURCurrency(); result = ConvertibleCurrency.CurrencyConvert(amount, fromCur, toCur); Assert.AreEqual(100.0M, result, "EUR to EUR should be no change"); decimal expected; fromCur = new USDCurrency(); toCur = new EURCurrency(); result = ConvertibleCurrency.CurrencyConvert(amount, fromCur, toCur); expected = amount * 0.85M; Assert.AreEqual(expected, result, "USD to EUR is incorrect"); fromCur = new PENCurrency(); toCur = new EURCurrency(); result = ConvertibleCurrency.CurrencyConvert(amount, fromCur, toCur); expected = amount / 3.53M * 0.85M; Assert.AreEqual(expected, result, "PEN to EUR is incorrect"); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PENCurrency obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PENCurrency obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }