示例#1
0
        public void ShouldReturnNullIfValueToConvertIsNullOrNotTransactionType()
        {
            TransactionTypeToStringConverter converter = new TransactionTypeToStringConverter();

            var convertedValue = converter.Convert(null, null, null, null) as string;

            Assert.IsNull(convertedValue);

            convertedValue = converter.Convert("NotATransactionType", null, null, null) as string;
            Assert.IsNull(convertedValue);
        }
示例#2
0
        public void ShouldConvertTransactionTypeValuesToString()
        {
            TransactionTypeToStringConverter converter = new TransactionTypeToStringConverter();

            var convertedValue = converter.Convert(TransactionType.Buy, null, null, null) as string;

            Assert.IsNotNull(convertedValue);
            Assert.AreEqual("BUY ", convertedValue);

            convertedValue = converter.Convert(TransactionType.Sell, null, null, null) as string;

            Assert.IsNotNull(convertedValue);
            Assert.AreEqual("SELL ", convertedValue);
        }