C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
Test_ExchangeRateProfile.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3
4using AnalyzeRe;
8
9#if MSTEST
10using Microsoft.VisualStudio.TestTools.UnitTesting;
11#elif NUNIT
12using TestClass = NUnit.Framework.TestFixtureAttribute;
13using TestMethod = NUnit.Framework.TestAttribute;
14using TestCategory = NUnit.Framework.CategoryAttribute;
15#endif
16
18{
19 [TestClass]
21 : BaseAbstractStoredResourceTestSuite<ExchangeRateProfile>
22 {
23 protected override bool PUT_Allowed => false;
25 }
26
27 [TestClass]
28 public sealed class TestSuite_ExchangeRateProfile : BaseImmutableResourceTestSuite<ExchangeRateProfile>
29 {
30 #region Set Up and Configuration
31 private const string TypeName = "ExchangeRateProfile";
34 #endregion Set Up and Configuration
35
36 #region POST
37 #region exchange_rate_table
38 [TestMethod, TestCategory(TypeName)]
40 {
41 POST_Attribute_Null(a => a.exchange_rate_table);
42 }
43 [TestMethod, TestCategory(TypeName)]
48 [TestMethod, TestCategory(TypeName)]
53 [TestMethod, TestCategory(TypeName)]
58 #endregion exchange_rate_table
59
60 #region rate_selection_order
61 [TestMethod, TestCategory(TypeName)]
63 {
64 POST_Attribute_Null(e => e.rate_selection_order);
65 }
66
67 [TestMethod, TestCategory(TypeName)]
69 {
70 POST_ListAttribute_Empty(e => e.rate_selection_order);
71 }
72
73 [TestMethod, TestCategory(TypeName)]
75 {
76 POST_WithValue(l => l.rate_selection_order,
78 {
79 new ExchangeRateDateRule
80 {
81 date = DateTime.UtcNow,
82 monetary_unit_overrides = new List<string>{"Rate", "Date"}
83 },
85 }, true);
86 }
87 [TestMethod, TestCategory(TypeName)]
89 {
90 POST_WithValue(l => l.rate_selection_order,
92 {
93 new ExchangeRateDateRule
94 {
95 date = DateTime.UtcNow,
96 monetary_unit_overrides = new List<string>{"rate", "DATE"}
97 },
99 }, false);
100 }
101 [TestMethod, TestCategory(TypeName)]
103 {
104 POST_WithValue(l => l.rate_selection_order,
106 {
107 new ExchangeRateDateRule
108 {
109 date = DateTime.UtcNow,
110 monetary_unit_overrides = new List<string>{"rate", "asdf"}
111 },
113 }, false);
114 }
115 #endregion rate_selection_order
116 #endregion POST
117 }
118}
Tests for a stored resource collection which do not require an instance of that resource to be define...
Exposes sample resource objects, with built-in methods for injecting dependencies.
Definition Samples.cs:14
IInjectableResource< ExchangeRateProfile > ExchangeRateProfile
override IResourceCollection< ExchangeRateProfile > collection_source
override IInjectableResource< ExchangeRateProfile > TestInjectableResource
Describes a collection of resources which can be listed.
API methods / requests made available to the user.
static readonly ResourceCollection< ExchangeRateProfile > ExchangeRateProfiles
The collection of ExchangeRateProfiles on the server.
A rule indicating that the latest available exchange rate should be used.