C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
Test_Analysis.cs
Go to the documentation of this file.
1using System;
2using AnalyzeRe;
6
7#if MSTEST
8using Microsoft.VisualStudio.TestTools.UnitTesting;
9#elif NUNIT
10using TestClass = NUnit.Framework.TestFixtureAttribute;
11using TestMethod = NUnit.Framework.TestAttribute;
12using TestCategory = NUnit.Framework.CategoryAttribute;
13#endif
14
16{
17 [TestClass]
18 [Obsolete("This tests a now obsolete class for backwards compatibility purposes.")]
23
24 [TestClass]
25 [Obsolete("This tests a now obsolete class for backwards compatibility purposes.")]
26 public sealed class TestSuite_Analysis_VendorPortfolioAnalysis : TestSuite_Analysis<VendorPortfolioAnalysis>
27 {
28 #region Set Up and Configuration
29 private const string TypeName = "VendorPortfolioAnalysis";
32 #endregion Set Up and Configuration
33 }
34
35 [TestClass]
36 [Obsolete("This tests a now obsolete class for backwards compatibility purposes.")]
37 public sealed class TestSuite_Analysis_VendorTreatyAnalysis : TestSuite_Analysis<VendorTreatyAnalysis>
38 {
39 #region Set Up and Configuration
40 private const string TypeName = "VendorTreatyAnalysis";
43 #endregion Set Up and Configuration
44 }
45
47 [TestClass]
48 [Obsolete("This tests a now obsolete class for backwards compatibility purposes.")]
50 {
51 private const string TypeName = "Analysis";
52
53 #region POST
54 #region agent
55 [TestMethod, TestCategory(TypeName)]
56 public virtual void Test_Analysis_POST_Agent_Null()
57 {
58 POST_Attribute_Null(a => a.agent);
59 }
60 [TestMethod, TestCategory(TypeName)]
62 {
63 POST_Reference_NullId(a => a.agent);
64 }
65 [TestMethod, TestCategory(TypeName)]
70 [TestMethod, TestCategory(TypeName)]
75 #endregion agent
76
77 #region host
78 [TestMethod, TestCategory(TypeName)]
79 public virtual void Test_Analysis_POST_Host_Null()
80 {
81 POST_Attribute_Null(a => a.host);
82 }
83 [TestMethod, TestCategory(TypeName)]
84 public virtual void Test_Analysis_POST_Host_Blank()
85 {
87 }
88 #endregion host
89
90 #region identifier
91 [TestMethod, TestCategory(TypeName)]
93 {
94 POST_Attribute_Null(a => a.identifier);
95 }
96 [TestMethod, TestCategory(TypeName)]
98 {
99 POST_StringAttribute_Empty(a => a.identifier);
100 }
101 #endregion identifier
102
103 #region source
104 [TestMethod, TestCategory(TypeName)]
105 public virtual void Test_Analysis_POST_Source_Null()
106 {
107 POST_Attribute_Null(a => a.source);
108 }
109 [TestMethod, TestCategory(TypeName)]
111 {
112 POST_StringAttribute_Empty(a => a.source);
113 }
114 #endregion source
115
116 #region vendor
117 [TestMethod, TestCategory(TypeName)]
118 public virtual void Test_Analysis_POST_Vendor_Null()
119 {
120 POST_Attribute_Null(a => a.vendor);
121 }
122 [TestMethod, TestCategory(TypeName)]
124 {
125 POST_StringAttribute_Empty(a => a.vendor);
126 }
127 #endregion vendor
128 #endregion POST
129
130 #region PUT
131 #region agent
132 [TestMethod, TestCategory(TypeName)]
133 public virtual void Test_Analysis_PUT_Agent()
134 {
135 PUT_WithValue(a => a.agent, Samples.Agent.AsReference, true);
136 }
137 [TestMethod, TestCategory(TypeName)]
138 public virtual void Test_Analysis_PUT_Agent_Null()
139 {
140 PUT_Attribute_Null(a => a.agent);
141 }
142 [TestMethod, TestCategory(TypeName)]
144 {
145 PUT_Reference_NullId(a => a.agent);
146 }
147 [TestMethod, TestCategory(TypeName)]
149 {
151 }
152 [TestMethod, TestCategory(TypeName)]
154 {
156 }
157 #endregion agent
158
159 #region host
160 [TestMethod, TestCategory(TypeName)]
161 public virtual void Test_Analysis_PUT_Host()
162 {
163 PUT_WithValue(a => a.host, "Modified Host", true);
164 }
165 [TestMethod, TestCategory(TypeName)]
166 public virtual void Test_Analysis_PUT_Host_Null()
167 {
168 PUT_Attribute_Null(a => a.host);
169 }
170 [TestMethod, TestCategory(TypeName)]
171 public virtual void Test_Analysis_PUT_Host_Blank()
172 {
174 }
175 #endregion host
176
177 #region identifier
178 [TestMethod, TestCategory(TypeName)]
179 public virtual void Test_Analysis_PUT_Identifier()
180 {
181 PUT_WithValue(a => a.identifier, "Modified Identifier", true);
182 }
183 [TestMethod, TestCategory(TypeName)]
185 {
186 PUT_Attribute_Null(a => a.identifier);
187 }
188 [TestMethod, TestCategory(TypeName)]
190 {
191 PUT_StringAttribute_Empty(a => a.identifier);
192 }
193 #endregion identifier
194
195 #region source
196 [TestMethod, TestCategory(TypeName)]
197 public virtual void Test_Analysis_PUT_Source()
198 {
199 PUT_WithValue(a => a.source, "Modified Source", true);
200 }
201 [TestMethod, TestCategory(TypeName)]
202 public virtual void Test_Analysis_PUT_Source_Null()
203 {
204 PUT_Attribute_Null(a => a.source);
205 }
206 [TestMethod, TestCategory(TypeName)]
207 public virtual void Test_Analysis_PUT_Source_Blank()
208 {
209 PUT_StringAttribute_Empty(a => a.source);
210 }
211 #endregion source
212
213 #region vendor
214 [TestMethod, TestCategory(TypeName)]
215 public virtual void Test_Analysis_PUT_Vendor()
216 {
217 PUT_WithValue(a => a.vendor, "Modified Vendor", true);
218 }
219 [TestMethod, TestCategory(TypeName)]
220 public virtual void Test_Analysis_PUT_Vendor_Null()
221 {
222 PUT_Attribute_Null(a => a.vendor);
223 }
224 [TestMethod, TestCategory(TypeName)]
225 public virtual void Test_Analysis_PUT_Vendor_Blank()
226 {
227 PUT_StringAttribute_Empty(a => a.vendor);
228 }
229 #endregion vendor
230 #endregion PUT
231 }
232}
Tests for a stored resource collection which do not require an instance of that resource to be define...
void PUT_StringAttribute_Empty(Expression< Func< T, string > > PropertyExpression, bool? shouldSucceed=null)
Ensure that when doing a PUT with the specified attribute set to an empty string, the PUT succeeds or...
void POST_StringAttribute_Empty(Expression< Func< T, string > > PropertyExpression, bool? shouldSucceed=null)
Post a resource with the specified string set to an empty string.
Exposes sample resource objects, with built-in methods for injecting dependencies.
Definition Samples.cs:14
IInjectableResource< VendorTreatyAnalysis > Analysis_VendorTreatyAnalysis
IInjectableResource< VendorPortfolioAnalysis > Analysis_VendorPortfolioAnalysis
IInjectableResource< Agent > Agent
override IResourceCollection< Analysis > collection_source
override IInjectableResource< VendorPortfolioAnalysis > TestInjectableResource
override IInjectableResource< VendorTreatyAnalysis > TestInjectableResource
Includes tests that affect all types of Analyses.
Describes a collection of resources which can be listed.
API methods / requests made available to the user.
static readonly ResourceCollection< Analysis > Analyses
The collection of Analyses on the server.
Represents the metadata for a DataAgent analysis entity imported from a vendor.
Definition Analysis.cs:13
IReference< T > AsReference
A reference to the posted resource.