2using System.Collections.Generic;
9using Microsoft.VisualStudio.TestTools.UnitTesting;
14using TestCategory =
NUnit.Framework.CategoryAttribute;
23 private const string TypeName =
"BaseStoredResourceTest";
32 Assert.Inconclusive(
"RUN_OFFLINE = true");
53 #endregion description
55 #region created and modified
61 Assert.IsNotNull(
posted.created,
"Expected a 'created' date to be assigned.");
62 Assert.IsNotNull(
posted.modified,
"Expected a 'modified' date to be assigned.");
64 "Expected the created and modified date to be equal on a newly posted resource.");
67 #endregion created and modified
85 {
"Test1",
"TestValue" },
106 #region Collection GET Methods
112 Assert.Inconclusive(
"RUN_OFFLINE = true");
133 #endregion Collection GET Methods
void POST_StringAttribute_Empty(Expression< Func< T, string > > PropertyExpression, bool? shouldSucceed=null)
Post a resource with the specified string set to an empty string.
virtual T TestResource_Existing
The resource used for all unit tests that require a prepared and already posted resource....
virtual T TestResource
The resource used for all unit tests that require a valid prepared but unPOSTed resource.
virtual void POST_ThenDoAction(T validToPost, Action< T > toExecute)
Post a valid resource under the assumption that it will succeed, then perform an action on the result...
virtual void Test_Resource_GET_Existing_ResolveReferences()
IStoredAPIResource collections support reference resolution.
virtual void Test_Resource_POST_MetaData_MixedTypes()
virtual void Test_Resource_POST_Metadata_InvalidValues()
virtual void Test_Resource_Search()
All resources should support searching in a few fundamental ways.
virtual void Test_Resource_POST_Metadata_Null()
virtual void Test_Resource_POST_Description_Blank()
virtual void Test_Resource_POST_Metadata_Empty()
virtual void Test_Resource_POST_Description_Null()
virtual void Test_Resource_POST_CreatedAndModified()
static void ReferencesResolved(object obj)
Retrieve settings from environment variables if they exist, or the project settings file otherwise.
static bool RUN_OFFLINE
Controls whether tests that normally require a connection to the server should be allowed to try to r...
Describes a collection of resources which can be listed.
Parameters that can be added to your REST requests to access additional API features.
static RequestParameters ExpandReferences()
Can be added to your GET requests to recursively resolve resource references in the response....
API methods / requests made available to the user.
static ICollectionResponse< IAPIResource > SearchResourceList(Type resourceType, string searchTerms, IEnumerable< Parameter > requestParameters=null, string collectionNameOverride=null, int? timeout=null, SearchType searchType=SearchType.Basic)
Get a collection of resources from the server that match the specified search criteria.
SearchType
The search type determines the interpretation of the query string.
Interface for Base class used by all stored resources.