1using System.Collections.Generic;
2using System.Diagnostics;
15using Microsoft.VisualStudio.TestTools.UnitTesting;
21using TestCategory =
NUnit.Framework.CategoryAttribute;
45 #region Set Up and Configuration
47 private const string TypeName =
"AnalysisProfile";
52 #endregion Set Up and Configuration
84 #region event_catalogs
104 #endregion event_catalogs
140 .Change(
f =>
f.description,
"same name, different filter").Post();
155 attribute =
"Unknown",
156 values = new List<object> { 0d }
157 }.Post().ToReference()
161 #endregion loss_filters
163 #region exchange_rate_profile
189 #endregion exchange_rate_profile
191 #region yelt_loss_set_simulation_filtering
199 #endregion yelt_loss_set_simulation_filtering
201 #region round_sequences
209 #endregion round_sequences
216 POST_ThenDoAction(TestResource,
posted =>
218 Assert.IsTrue(
posted.status.IsBusy(),
"Expected the server behaviour to " +
219 "be one that asynchronously processes new Analysis Profiles.");
222 "Analysis Profile status to be \"processing_succeeded\"");
225 Debug.WriteLine(
test.id +
" posted, so analysis profile must be ready.");
231 #region default_perspective
235 Skip.
Indefinitely(
"ARE-6645: Remove skip and uncomment the AnalysisProfile.default_perspective" +
236 "ServerHasDefault attribute once API changes are complete.");
249 #endregion default_perspective
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.
static readonly PollingOptions DataPollingOptions
Polling options to use when uploading a data file.
IInjectableResource< AnalysisProfile > AnalysisProfile
An analysis profile with one of each possible type of filter.
Test the Perspective Class.
static IEnumerable< Perspective > TestPerspectives
Create a list of distinct perspectives to test.
override bool PUT_Allowed
override IResourceCollection< AnalysisProfile > collection_source
static string GetDefaultFilterNameForAnalysisProfile(IReference< AnalysisProfile > analysisProfile)
Get the name of the default filter of the analysis profile. This should be the first filter whose typ...
void Test_AnalysisProfile_POST_YeltLossSetSimulationFiltering()
void Test_AnalysisProfile_POST_RoundSequences()
void Test_AnalysisProfile_POST_LossFilters_Empty()
void Test_AnalysisProfile_POST_LossFilters_AllFilters()
override IInjectableResource< AnalysisProfile > TestInjectableResource
void Test_AnalysisProfile_POST_ExchangeRateProfile_Reference_EmptyStringId()
void Test_AnalysisProfile_POST_WaitForStatusToBeReady()
void Test_AnalysisProfile_POST_Simulation_Reference_NullId()
void Test_AnalysisProfile_POST_ExchangeRateProfile_Reference_NullId()
void Test_AnalysisProfile_POST_LossFilters_Invalid()
void Test_AnalysisProfile_POST_EventCatalogs_Null()
void Test_AnalysisProfile_POST_Simulation_Reference_NonExistantId()
void Test_LossSet_POST_DefaultPerspective_Null()
void Test_AnalysisProfile_POST_Simulation_Reference_EmptyStringId()
void Test_AnalysisProfile_POST_EventCatalogs_Invalid()
void Test_AnalysisProfile_POST_ExchangeRateProfile_Null()
void Test_AnalysisProfile_POST_LossFilters_MissingAttribute()
void Test_AnalysisProfile_POST_Simulation_Null()
void Test_AnalysisProfile_POST_ExchangeRateProfile_Reference_NonExistantId()
void Test_AnalysisProfile_POST_LossFilters_Null()
void Test_AnalysisProfile_POST_EventCatalogs_Empty()
void Test_LossSet_POST_DefaultPerspective()
void Test_AnalysisProfile_POST_LossFilters_UniqueNamesRequired()
A collection of filthy hacks to populate some fields of APIResources objects of any type.
Class used in unit tests to mark tests as skipped by using Assert.Inconclusive() method.
static void Indefinitely(string ticket=null)
Skip the specified test.
Describes a collection of resources which can be listed.
API methods / requests made available to the user.
static readonly ResourceCollection< AnalysisProfile > AnalysisProfiles
The collection of AnalysisProfiles on the server.
A configuration of resources used to simulate a layer or portfolio.
Filter is like a layer whose 'terms' are to filter events out of the loss sources....
Matches all losses (always returns true).
The loss perspective determines what factors to include when computing a distribution.
static Perspective LossNetOf(params Base[] perspectives)
A convenience static method, similar to the other static singletons, which constructs a complex persp...
Base
The set of available values and RecordTypes that can be used to construct a distribution or metrics r...
T Unposted
The unPOSTed resource definition.
Represents the Analysis of a Layer.
TaskStatus
The status of a data upload which may be in progress.