Beispiel #1
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var payment = (PaymentViewModel)value;

            if (payment == null)
            {
                return(string.Empty);
            }

            return(PaymentAmountConverterLogic.GetAmountSign(payment));
        }
        public void GetCorrectSignForExpenseAndIncome(PaymentType type, string expectedResult, int chargedAccountId, int currentAccountId)
        {
            // Arrange
            var payment = new PaymentViewModel {
                Type = type, ChargedAccountId = chargedAccountId, CurrentAccountId = currentAccountId
            };

            // Act
            string result = PaymentAmountConverterLogic.GetAmountSign(payment);

            // Assert
            result.Should().StartWith(expectedResult);
        }