예제 #1
0
        public ReceiptProperty Convert(ReceiptPropertyModel model)
        {
            ReceiptProperty receiptProperty = context.CreateEmptyReceiptProperty();

            receiptProperty.Key   = model.Key;
            receiptProperty.Value = model.Value;

            return(receiptProperty);
        }
예제 #2
0
        public void ReceiptPropertyModelConvertTest()
        {
            // Arange
            ReceiptPropertyModel model = new ReceiptPropertyModel()
            {
                Key   = "Key",
                Value = "Value"
            };

            Mock <BudgetContext> contextModck = new Mock <BudgetContext>();
            ModelConverter       converter    = new ModelConverter(contextModck.Object);

            // Act
            ReceiptProperty result = converter.Convert(model);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(model.Key, result.Key);
            Assert.AreEqual(model.Value, result.Value);
        }