public ReceiptProperty Convert(ReceiptPropertyModel model) { ReceiptProperty receiptProperty = context.CreateEmptyReceiptProperty(); receiptProperty.Key = model.Key; receiptProperty.Value = model.Value; return(receiptProperty); }
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); }