-
Notifications
You must be signed in to change notification settings - Fork 0
/
MarginProfile
48 lines (42 loc) · 1.64 KB
/
MarginProfile
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
[TestMethod]
public void TestPostWithModelObject()
{
IRestClient restClient = new RestClient();
IRestRequest request = new RestRequest()
{
Resource = postUrl
};
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer " + Token);
request.RequestFormat = DataFormat.Json;
request.JsonSerializer = new CustomJsonSerializer();
request.AddBody(GetProfile());
IRestResponse response = restClient.Post(request);
Assert.AreEqual(201, (int)response.StatusCode);
Console.WriteLine(response.Content);
}
private MarginProfile GetProfile()
{
MileMarkups range1 = new MileMarkups(1, 100);
MileMarkups range2 = new MileMarkups(101, 200);
MileMarkups range3 = new MileMarkups(251, 250);
List<MileMarkups> ranges = new List<MileMarkups>()
{
range1,
range2,
range3
};
MarginProfile Profile = new MarginProfile()
{
customerId = 683746,
trailerGroup = "Van",
fuelSurcharge = 3,
overrideDefaultFuelSurcharge = true,
overrideDefaultLDIMarkup = true,
truckPayAdjustment = 1,
overrideDefaultTruckPayAdjustment = true,
overrideDefaultMileMarkups = true,
mileMarkups = ranges
};
return Profile;
}