C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
Test_Agent.cs
Go to the documentation of this file.
1using System;
2using AnalyzeRe;
5
6#if MSTEST
7using Microsoft.VisualStudio.TestTools.UnitTesting;
8#elif NUNIT
9using TestClass = NUnit.Framework.TestFixtureAttribute;
10using TestMethod = NUnit.Framework.TestAttribute;
11using TestCategory = NUnit.Framework.CategoryAttribute;
12#endif
13
15{
16 [TestClass]
17 [Obsolete("This tests a now obsolete class for backwards compatibility purposes.")]
22
23 [TestClass]
24 [Obsolete("This tests a now obsolete class for backwards compatibility purposes.")]
25 public sealed class TestSuite_Agent : BaseMutableResourceTestSuite<Agent>
26 {
27 #region Set Up and Configuration
28 private const string TypeName = "Agent";
29 protected override IInjectableResource<Agent>
31 #endregion Set Up and Configuration
32
33 #region POST
34 #region hostname
35 [TestMethod, TestCategory(TypeName)]
37 {
38 POST_Attribute_Null(a => a.hostname);
39 }
40 [TestMethod, TestCategory(TypeName)]
42 {
43 POST_StringAttribute_Empty(a => a.hostname);
44 }
45 #endregion hostname
46 #endregion POST
47
48 #region PUT
49 #region hostname
50 [TestMethod, TestCategory(TypeName)]
52 {
53 PUT_WithValue(a => a.hostname, "Modified Hostname", true);
54 }
55 [TestMethod, TestCategory(TypeName)]
57 {
58 PUT_Attribute_Null(a => a.hostname);
59 }
60 [TestMethod, TestCategory(TypeName)]
62 {
63 PUT_StringAttribute_Empty(a => a.hostname);
64 }
65 #endregion hostname
66 #endregion PUT
67 }
68}
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...
Exposes sample resource objects, with built-in methods for injecting dependencies.
Definition Samples.cs:14
IInjectableResource< Agent > Agent
override IResourceCollection< Agent > collection_source
Definition Test_Agent.cs:20
override IInjectableResource< Agent > TestInjectableResource
Definition Test_Agent.cs:30
Describes a collection of resources which can be listed.
API methods / requests made available to the user.
static readonly ResourceCollection< Agent > Agents
The collection of Agents on the server.