C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
BaseImmutableResourceTestSuite.cs
Go to the documentation of this file.
1using System.Net;
2using AnalyzeRe;
5#if MSTEST
6using Microsoft.VisualStudio.TestTools.UnitTesting;
7#elif NUNIT
8using TestClass = NUnit.Framework.TestFixtureAttribute;
9using TestMethod = NUnit.Framework.TestAttribute;
10using TestCategory = NUnit.Framework.CategoryAttribute;
11#endif
12
14{
15 [TestClass]
17 {
18 #region Properties
19 private const string TypeName = "BaseImmutableResourceTest";
20 #endregion Properties
21
22 [TestMethod, TestCategory(TypeName)]
23 public virtual void Test_Resource_PUT_NotAllowed()
24 {
25 // Show that PUT method fails with "MethodNotAllowed" for immutable resources (even if no changes were made)
26 AssertApi.ExceptionThrown(() => TestResource_Existing.Put(),
27 AssertApi.ApiExceptionTest(HttpStatusCode.MethodNotAllowed));
28 }
29 }
30}
virtual T TestResource_Existing
The resource used for all unit tests that require a prepared and already posted resource....
static Action< APIRequestException > ApiExceptionTest(HttpStatusCode expectedStatusCode)
Generate a function that will test a REST request exception in a standard way.
Definition AssertApi.cs:539
Describes a collection of resources which can be listed.
Interface for Base class used by all stored resources.