9using Microsoft.VisualStudio.TestTools.UnitTesting;
12using TestClass = NUnit.Framework.TestFixtureAttribute;
13using TestMethod = NUnit.Framework.TestAttribute;
14using TestCategory = NUnit.Framework.CategoryAttribute;
24 private const string Category =
"SimulationOptions";
26 #region Reporting Period
39 Assert.Inconclusive(
"RUN_OFFLINE = true");
44 AssertReportingPeriodMatches(options, metrics.
context);
47 AssertReportingPeriodMatches(options, windowMetrics.
context);
50 AssertReportingPeriodMatches(options, cometrics.
context);
53 AssertReportingPeriodMatches(options, exprob.
context);
58 [TestMethod, TestCategory(Category)]
65 [TestMethod, TestCategory(Category)]
72 [TestMethod, TestCategory(Category)]
76 new ReportingPeriod(
new DateTime(DateTime.MinValue.Ticks, DateTimeKind.Utc))));
79 [TestMethod, TestCategory(Category)]
83 new ReportingPeriod(end:
new DateTime(DateTime.MaxValue.Ticks, DateTimeKind.Utc))));
86 [TestMethod, TestCategory(Category)]
93 [TestMethod, TestCategory(Category)]
96 DateTime now =
new DateTime(DateTime.UtcNow.Ticks, DateTimeKind.Unspecified);
98 new ReportingPeriod(
new DateTimeOffset(now, TimeSpan.FromHours(1)).LocalDateTime,
99 new DateTimeOffset(now, TimeSpan.FromHours(-1)).LocalDateTime)));
102 [TestMethod, TestCategory(Category)]
105 DateTime now = DateTime.UtcNow;
108 (ArgumentException ex) => Assert.AreEqual(
"When both a begin and end date are specified, " +
109 "the begin date must be less than end date.", ex.Message));
111 #endregion Reporting Period
Create a test class that takes care of setting the server URL and cleaning up after each unit test.
Exposes sample resource objects, with built-in methods for injecting dependencies.
IInjectableResource< ILayerView< CatXL > > LayerView_CatXL
Test the ReportingPeriod class to ensure ReportingPeriods instantiated in different ways can be succe...
void Test_ReportingPeriod_Constructor_BeginEqualsEnd()
void Test_ReportingPeriod_End_MaxDate()
void Test_ReportingPeriod_TimezoneOffsets()
void Test_ReportingPeriod_EndOnly()
void Test_ReportingPeriod_Begin_MinDate()
void Test_ReportingPeriod_BeginAndEnd()
void Test_ReportingPeriod_BeginOnly()
Contains static helper methods for testing IAPIResourceView instances.
static readonly PollingOptions SimulationPolling
Settings used to ensure simulation requests are retried frequently and timeout after a reasonable amo...
static void DatesAreEqual(DateTime? dt1, DateTime? dt2, string propertyName="DateTime")
Asserts that two dates are equal within the supported precision. Analyze Re only supports a precision...
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...
Optional parameters which can be specified for co-metrics requests.
The structure returned when requesting Co-Metrics for a view.
Context context
The context of a co-metrics request, indicating what parameters were used in the simulation that prod...
The common components of the context returned from any metrics request, indicating what parameters we...
DateTime? reporting_period_begin
The reporting period starting DateTime (if it was set), which restricts results to only include losse...
DateTime? reporting_period_end
The reporting period ending DateTime (if it was set), which restricts results to only include losses ...
Optional parameters which can be specified for exceedance probability requests.
The structure returned when requesting Exceedance Probability for a view.
Context context
The context of a tail metrics request, indicating what parameters were used in the simulation that pr...
Optional parameters which can be specified for all metrics requests.
A reporting period which dictates optional begin and end dates to constrain what event losses are inc...
DateTime? end
(Optional) The exclusive end date of the reporting period. If specified, event losses occurring on or...
DateTime? begin
(Optional) The inclusive start date of the reporting period. If specified, event losses occurring bef...
Optional parameters which can be specified for all simulation result requests. Includes a variety of ...
ReportingPeriod reporting_period
A reporting period which dictates optional begin and end dates to constrain what event losses are inc...
The structure returned when requesting Tail Metrics for a view.
Context context
The context of a tail metrics request, indicating what parameters were used in the simulation that pr...
The structure returned when requesting Window Metrics for a view, containing the core window distribu...
Context context
The context of a window metrics request, indicating what parameters were used in the simulation that ...
Determines the behaviour of the API when automatically retrying a request whose result is not yet rea...
A probability range used to dictate the set of ordered trial losses in a loss distribution that shoul...
static ProbabilityWindow All
Returns a window representing the full probability range [0, 1], such that all trial losses will be i...
T Posted
The posted resource, ready to be referenced.
Represents the Analysis of a Layer.