-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTemplateFileMappingTests.cs
More file actions
61 lines (54 loc) · 1.98 KB
/
TemplateFileMappingTests.cs
File metadata and controls
61 lines (54 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using ObjectSemantics.NET.Tests.MoqModels;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Xunit;
namespace ObjectSemantics.NET.Tests
{
public class TemplateFileMappingTests
{
[Fact]
public void Should_Map_Large_File_Template()
{
string template = File.ReadAllText("MoqFiles/PaymentTemplate.xml", Encoding.UTF8);
string expectedResult = File.ReadAllText("MoqFiles/PaymentTemplate.result.xml", Encoding.UTF8);
var payment = new CustomerPayment
{
Id = 12719,
CustomerId = 54,
Amount = 300.0,
LedgerAccountId = 1,
ReferenceNo = "CP-20251029-14QH",
PaidBy = "JOHN DOE",
PaymentDate = DateTime.Parse("2025-10-29T14:03:19.4147588"),
RegisteredBy = "George Waynne",
Customer = new Customer
{
Id = 54,
FirstName = "JOHN DOE",
LastName = "ENTERPRISES",
CompanyName = "John Doe Enterprises",
},
Narration = null,
CustomerName = "JOHN DOE ENTERPRISES",
LedgerAccountName = "Cash A/C"
};
//additional headers
var additionalParams = new Dictionary<string, object>
{
["BranchName"] = "MAIN BRANCH",
["CompanyName"] = "TEST COMPANY",
["CompanyEmail"] = "test@gmail.com",
["CompanyAddress"] = "Test Address",
["CompanyMobile"] = "+2547000000001",
["customer_prevBalance"] = "19,395.00",
["customer_currentBalance"] = "19,095.00",
["CompanyLogo"] = "logo.jpg",
};
//map
string result = payment.Map(template, additionalParams);
Assert.Equal(result, expectedResult);
}
}
}