C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
Test_Distribution.cs
Go to the documentation of this file.
1using System;
2
3using AnalyzeRe;
10
11#if MSTEST
12using Microsoft.VisualStudio.TestTools.UnitTesting;
13#elif NUNIT
14using TestClass = NUnit.Framework.TestFixtureAttribute;
15using TestMethod = NUnit.Framework.TestAttribute;
16using TestCategory = NUnit.Framework.CategoryAttribute;
17#endif
18
20{
21 [TestClass]
23 {
25
28 public static double MaxSafeFrequencyDistributionMean = 1000;
29
33 {
34 Console.WriteLine("Verifying that we can safely post a new " +
35 $"ParametricLossSet with a reference to this {posted.GetType().NiceTypeName()}");
36
37 // 1. Create a new ParametricLossSet containing this distribution
39 // If distribution is one of the custom distribution types, assign it accordingly
41 lossSet.severity = asCustomSeverityDistribution.ToReference();
43 lossSet.seasonality = asCustomSeasonalityDistribution.ToReference();
45 {
47 return;
48 lossSet.frequency = asCustomFrequencyDistribution.ToReference();
49 }
50 // Any other continuous distribution can be safely used as the severity
52 lossSet.severity = asContinuous.ToReference();
53 // Otherwise, discrete distributions can only be used as a frequency distribution
55 {
57 return;
58 lossSet.frequency = asDiscrete.ToReference();
59 }
60 else
61 throw new ArgumentException($"Unhandled distribution type {posted.GetType()} " +
62 "does not appear to be Continuous or Discrete. Unsure how to use it.");
63
64 // Test that the distribution can be referenced in a Parametric loss set without issue.
65 lossSet = lossSet.Post();
66 // Now test that our new loss set can be simulated.
67 TestSuite_LossSet_Base.Test_LossSet_Simulatable(lossSet);
68 }
69
73 {
74 // Catch any distributions that might lead to the Bug ARE-5686
75 if (frequencyDistribution.min_val.HasValue && frequencyDistribution.min_val.Value < 0)
76 throw new ArgumentException("This distribution is decidedly invalid, " +
77 "because it can only be tested as a frequency distribution, and its " +
78 "profile suggests that it might generate a negative number of occurrences:\n" +
79 frequencyDistribution.Serialize(true));
80 // Frequency distributions with a large mean will run for too long.
81 if (frequencyDistribution.mean_val.HasValue &&
83 {
84 Console.WriteLine("Cannot safely determine whether this distribution can be simulated, " +
85 "because it can only be tested as a frequency distribution, and its " +
86 "profile suggests that it would generate a large number of occurrences:\n" +
87 frequencyDistribution.Serialize(true));
88 return false;
89 }
90 // Distrust frequency distributions that do not report their mean value (ARE-7227)
91 if (!frequencyDistribution.mean_val.HasValue)
92 {
93 // The exception is if there is a modulo in place to cap its maximum value
94 if (frequencyDistribution.modulo.HasValue &&
96 return true;
97 Console.WriteLine("Cannot safely determine that this distribution can be simulated, " +
98 "because it can only be tested as a frequency distribution, and its " +
99 "profile gives no indication of how many occurrences it might generate:\n" +
100 frequencyDistribution.Serialize(true));
101 return false;
102 }
103 return true;
104 }
105 }
106
107 #region CustomDistribution Derived Types Test Classes
108 [TestClass]
110 : TestSuite_CustomDistribution<CustomFrequencyDistribution>
111 {
112 #region Set Up and Configuration
113 private const string TypeName = "CustomFrequencyDistribution";
116
118 #endregion Set Up and Configuration
119 }
120
121 [TestClass]
123 : TestSuite_CustomDistribution<CustomSeasonalityDistribution>
124 {
125 #region Set Up and Configuration
126 private const string TypeName = "CustomSeasonalityDistribution";
129
131 #endregion Set Up and Configuration
132 }
133
134 [TestClass]
136 : TestSuite_CustomDistribution<CustomSeverityDistribution>
137 {
138 #region Set Up and Configuration
139 private const string TypeName = "CustomSeverityDistribution";
142
144 #endregion Set Up and Configuration
145 }
146 #endregion CustomDistribution Derived Types Test Classes
147
148 #region Other Distribution Test Classes
149 [TestClass]
151 : TestSuite_Distribution<BinomialDistribution>
152 {
153 #region Set Up and Configuration
154 private const string TypeName = "BinomialDistribution";
157 #endregion Set Up and Configuration
158
159 #region POST
160 #region n
161 [TestMethod, TestCategory(TypeName)]
163 {
164 POST_WithValue(d => d.n, Int32.MaxValue, true);
165 POST_WithValue(d => d.n, 0, true);
166 }
167 [TestMethod, TestCategory(TypeName)]
169 {
170 POST_WithValue(d => d.n, -1, false);
171 POST_WithValue(d => d.n, Int32.MinValue, false);
172 }
173 #endregion n
174
175 #region p
176 [TestMethod, TestCategory(TypeName)]
178 {
179 POST_WithValue(d => d.p, 1d, true);
180 POST_WithValue(d => d.p, 0d, true);
182 }
183 [TestMethod, TestCategory(TypeName)]
185 {
186 // Greater than allowed domain
187 POST_WithValue(d => d.p, 1.01, false);
188 // Smaller than allowed domain
190 // Forbidden Special Values
191 POST_WithValue(d => d.p, Double.PositiveInfinity, false);
192 POST_WithValue(d => d.p, Double.NaN, false);
193 POST_WithValue(d => d.p, Double.NegativeInfinity, false);
194 }
195 #endregion p
196 #endregion POST
197 }
198
199 [TestClass]
201 : TestSuite_Distribution<LogNormalDistribution>
202 {
203 #region Set Up and Configuration
204 private const string TypeName = "LogNormalDistribution";
207 #endregion Set Up and Configuration
208
209 #region POST
210 #region location
211 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
213 {
214 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
215 POST_WithValue(d => d.location, Double.MaxValue, true);
216 }
217 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
219 {
220 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
221 POST_WithValue(d => d.location, Double.MinValue, true);
222 }
223 [TestMethod, TestCategory(TypeName)]
225 {
226 //POST_WithValue(d => d.location, Double.MaxValue, true);
227 POST_WithValue(d => d.location, LargePostiveDoubleValue, true);
228 POST_WithValue(d => d.location, HighPrecisionValue, true);
229 POST_WithValue(d => d.location, 0d, true);
230 POST_WithValue(d => d.location, LargeNegativeDoubleValue, true);
231 //POST_WithValue(d => d.location, Double.MinValue, true);
232 }
233 [TestMethod, TestCategory(TypeName)]
235 {
236 // Forbidden Special Values
237 POST_WithValue(d => d.location, Double.PositiveInfinity, false);
238 POST_WithValue(d => d.location, Double.NaN, false);
239 POST_WithValue(d => d.location, Double.NegativeInfinity, false);
240 }
241 #endregion location
242
243 #region scale
244 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
246 {
247 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
248 POST_WithValue(d => d.scale, Double.MaxValue, true);
249 }
250 [TestMethod, TestCategory(TypeName)]
252 {
253 //POST_WithValue(d => d.scale, Double.MaxValue, true);
254 POST_WithValue(d => d.scale, LargePostiveDoubleValue, true);
256 POST_WithValue(d => d.scale, HighPrecisionValue, true);
257 }
258 [TestMethod, TestCategory(TypeName)]
260 {
261 // Start of forbidden domain
262 POST_WithValue(d => d.scale, 0, false);
263 // Forbidden Special Values
264 POST_WithValue(d => d.scale, Double.PositiveInfinity, false);
265 POST_WithValue(d => d.scale, Double.NaN, false);
266 POST_WithValue(d => d.scale, Double.NegativeInfinity, false);
267 }
268 #endregion scale
269 #endregion POST
270 }
271
272 [TestClass]
274 : TestSuite_Distribution<NegativeBinomialDistribution>
275 {
276 #region Set Up and Configuration
277 private const string TypeName = "NegativeBinomialDistribution";
280 #endregion Set Up and Configuration
281
282 #region POST
283 #region r
284 [TestMethod, TestCategory(TypeName)]
286 {
287 POST_WithValue(d => d.r, Double.MaxValue, true);
290 }
291 [TestMethod, TestCategory(TypeName)]
293 {
294 // Start of forbidden domain
295 POST_WithValue(d => d.r, 0, false);
296 // Forbidden Special Values
297 POST_WithValue(d => d.r, Double.PositiveInfinity, false);
298 POST_WithValue(d => d.r, Double.NaN, false);
299 POST_WithValue(d => d.r, Double.NegativeInfinity, false);
300 }
301 #endregion r
302
303 #region p
304 [TestMethod, TestCategory(TypeName)]
306 {
307 POST_WithValue(d => d.p, 1d, true);
308 POST_WithValue(d => d.p, 0d, true);
310 }
311 [TestMethod, TestCategory(TypeName)]
313 {
314 // Greater than allowed domain
315 POST_WithValue(d => d.p, 1.01, false);
316 // Smaller than allowed domain
318 // Forbidden Special Values
319 POST_WithValue(d => d.r, Double.PositiveInfinity, false);
320 POST_WithValue(d => d.r, Double.NaN, false);
321 POST_WithValue(d => d.r, Double.NegativeInfinity, false);
322 }
323 #endregion p
324 #endregion POST
325 }
326
327 [TestClass]
329 : TestSuite_Distribution<NormalDistribution>
330 {
331 #region Set Up and Configuration
332 private const string TypeName = "NormalDistribution";
335 #endregion Set Up and Configuration
336
337 #region POST
338 #region mean
339 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
341 {
342 // TODO: Consolidate with the 'ValidDomain' test when bug is fixed.
343 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
344 POST_WithValue(d => d.mean, Double.MaxValue, true);
345 }
346 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
348 {
349 // TODO: Consolidate with the 'ValidDomain' test when bug is fixed.
350 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
351 POST_WithValue(d => d.mean, Double.MinValue, false);
352 }
353 [TestMethod, TestCategory(TypeName)]
360 [TestMethod, TestCategory(TypeName)]
362 {
363 // Forbidden Special Values
364 POST_WithValue(d => d.mean, Double.PositiveInfinity, false);
365 POST_WithValue(d => d.mean, Double.NaN, false);
366 POST_WithValue(d => d.mean, Double.NegativeInfinity, false);
367 }
368 #endregion mean
369
370 #region stddev
371 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
373 {
374 // TODO: Consolidate with the 'ValidDomain' test when bug is fixed.
375 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
376 POST_WithValue(d => d.stddev, Double.MaxValue, true);
377 }
378 [TestMethod, TestCategory(TypeName)]
385 [TestMethod, TestCategory(TypeName)]
387 {
388 // Start of forbidden domain
389 POST_WithValue(d => d.stddev, 0, false);
390 // Forbidden Special Values
391 POST_WithValue(d => d.stddev, Double.PositiveInfinity, false);
392 POST_WithValue(d => d.stddev, Double.NaN, false);
393 POST_WithValue(d => d.stddev, Double.NegativeInfinity, false);
394 }
395 #endregion stddev
396 #endregion POST
397 }
398
399 [TestClass]
401 : TestSuite_Distribution<DiracDistribution>
402 {
403 #region Set Up and Configuration
404 private const string TypeName = "DiracDistribution";
407 #endregion Set Up and Configuration
408
409 #region POST
410 #region value
411 [TestMethod, TestCategory(TypeName)]
413 {
414 POST_WithValue(d => d.value, Double.MaxValue, true);
415 POST_WithValue(d => d.value, 0d, true);
416 POST_WithValue(d => d.value, Double.MinValue, true);
417 POST_WithValue(d => d.value, HighPrecisionValue, true);
418 }
419 [TestMethod, TestCategory(TypeName)]
421 {
422 // Forbidden Special Values
423 POST_WithValue(d => d.value, Double.PositiveInfinity, false);
424 POST_WithValue(d => d.value, Double.NaN, false);
425 POST_WithValue(d => d.value, Double.NegativeInfinity, false);
426 }
427 #endregion value
428 #endregion POST
429 }
430
431 [TestClass]
433 : TestSuite_Distribution<ParetoDistribution>
434 {
435 #region Set Up and Configuration
436 private const string TypeName = "ParetoDistribution";
439 #endregion Set Up and Configuration
440
441 #region POST
442 #region shape
443 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
445 {
446 // TODO: Consolidate with the 'ValidDomain' test when bug is fixed.
447 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
448 POST_WithValue(d => d.shape, Double.MaxValue, true);
449 }
450 [TestMethod, TestCategory(TypeName)]
457 [TestMethod, TestCategory(TypeName)]
459 {
460 // Start of forbidden domain
461 POST_WithValue(d => d.shape, 0, false);
462 // Forbidden Special Values
463 POST_WithValue(d => d.shape, Double.PositiveInfinity, false);
464 POST_WithValue(d => d.shape, Double.NaN, false);
465 POST_WithValue(d => d.shape, Double.NegativeInfinity, false);
466 }
467 #endregion shape
468
469 #region scale
470 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
472 {
473 // TODO: Consolidate with the 'ValidDomain' test when bug is fixed.
474 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
475 POST_WithValue(d => d.scale, Double.MaxValue, true);
476 }
477 [TestMethod, TestCategory(TypeName)]
484 [TestMethod, TestCategory(TypeName)]
486 {
487 // Start of forbidden domain
488 POST_WithValue(d => d.scale, 0, false);
489 // Forbidden Special Values
490 POST_WithValue(d => d.scale, Double.PositiveInfinity, false);
491 POST_WithValue(d => d.scale, Double.NaN, false);
492 POST_WithValue(d => d.scale, Double.NegativeInfinity, false);
493 }
494 #endregion scale
495 #endregion POST
496 }
497
498 [TestClass]
500 : TestSuite_Distribution<PoissonDistribution>
501 {
502 #region Set Up and Configuration
503 private const string TypeName = "PoissonDistribution";
506
507 #endregion Set Up and Configuration
508
509 #region POST
510 #region mean
511 [TestMethod, TestCategory(TypeName)]
513 {
514 POST_WithValue(d => d.mean, Double.MaxValue, true);
517 POST_WithValue(d => d.mean, HighPrecisionValue, true);
518 }
519 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
521 {
522 // TODO: Consolidate with the 'InvalidDomain' test when bug is fixed.
523 Skip.UntilRelease.Validation("ARE-6286 - PoissonDistribution.mean " +
524 "should not be equal to zero (but API allows it).");
525 POST_WithValue(d => d.mean, 0d, false);
526 }
527 [TestMethod, TestCategory(TypeName)]
529 {
530 // Start of forbidden domain
531 //POST_WithValue(d => d.mean, 0d, false);
533 // Forbidden Special Values
534 POST_WithValue(d => d.mean, Double.NaN, false);
535 POST_WithValue(d => d.mean, Double.PositiveInfinity, false);
536 }
537 #endregion mean
538 #endregion POST
539 }
540
541 [TestClass]
543 : TestSuite_Distribution<UniformDistribution>
544 {
545 #region Set Up and Configuration
546 private const string TypeName = "UniformDistribution";
549 #endregion Set Up and Configuration
550
551 #region POST
552 #region lower
553 [TestMethod, TestCategory(TypeName)]
555 {
556 // Note: We're conscientious not to test with any values >= TestResource.upper
558 POST_WithValue(d => d.lower, HighPrecisionValue, true);
561 }
562 [TestMethod, TestCategory(TypeName)]
564 {
565 // TODO: Consolidate with the 'ValidDomain' test when bug is fixed.
566 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
567 POST_WithValue(d => d.lower, Double.MinValue, true);
568 }
569 [TestMethod, TestCategory(TypeName)]
571 {
572 // Forbidden Special Values
573 POST_WithValue(d => d.lower, Double.NegativeInfinity, false);
574 POST_WithValue(d => d.lower, Double.NaN, false);
575 }
576 #endregion lower
577
578 #region upper
579 [TestMethod, TestCategory(TypeName)]
581 {
582 // TODO: Consolidate with the 'ValidDomain' test when bug is fixed.
583 Skip.Indefinitely("ARE-6046: +/-Inf in distributions cause internal errors.");
584 POST_WithValue(d => d.upper, Double.MaxValue, true);
585 }
586 [TestMethod, TestCategory(TypeName)]
588 {
589 // Note: We're conscientious not to test with any values <= TestResource.lower
590 POST_WithValue(d => d.upper, LargePostiveDoubleValue, true);
591 POST_WithValue(d => d.upper, Math.PI, true);
592 }
593 [TestMethod, TestCategory(TypeName)]
595 {
596 // Forbidden Special Values
597 POST_WithValue(d => d.upper, Double.PositiveInfinity, false);
598 POST_WithValue(d => d.upper, Double.NaN, false);
599 }
600 [TestMethod, TestCategory(TypeName)]
602 {
603 POST_WithValue(d => d.upper, TestResource.lower, false);
604 POST_WithValue(d => d.upper, TestResource.lower - 1, false);
605 POST_WithValue(d => d.upper, Double.NegativeInfinity, false);
606 }
607 #endregion upper
608 #endregion POST
609 }
610
611 [TestClass]
613 : TestSuite_Distribution<UniformIntDistribution>
614 {
615 #region Set Up and Configuration
616 private const string TypeName = "UniformIntDistribution";
619 #endregion Set Up and Configuration
620
621 #region POST
622 #region lower
623 [TestMethod, TestCategory(TypeName)]
625 {
626 // Note: We're conscientious not to test with any values >= TestResource.upper
627 POST_WithValue(d => d.lower, 1, true);
628 POST_WithValue(d => d.lower, 0, true);
629 }
630
631 [TestMethod, TestCategory(TypeName), TestCategory("Skipped")]
633 {
634 Skip.UntilRelease.Validation("ARE-6282: UniformIntDistribution.lower " +
635 "less than 1 is allowed, but causes internal errors.");
636 POST_WithValue(d => d.lower, -1, false);
637 POST_WithValue(d => d.lower, Int32.MinValue, false);
638 }
639 #endregion lower
640
641 #region upper
642 [TestMethod, TestCategory(TypeName)]
644 {
645 // Note: We're conscientious not to test with any values <= TestResource.lower
646 POST_WithValue(d => d.upper, TestResource.lower + 1, true);
647 POST_WithValue(d => d.upper, Int32.MaxValue, true);
648 }
649 [TestMethod, TestCategory(TypeName)]
651 {
652 POST_WithValue(d => d.upper, TestResource.lower, false);
653 POST_WithValue(d => d.upper, TestResource.lower - 1, false);
654 POST_WithValue(d => d.upper, Int32.MinValue, false);
655 }
656 #endregion upper
657 #endregion POST
658 }
659 #endregion Other Distribution Test Classes
660
661 #region Abstract Base Test Classes
665 [TestClass]
668 {
669 private const string TypeName = "CustomDistribution";
670
673
674 #region POST
675 #region modulo
676 [TestMethod, TestCategory(TypeName)]
678 {
679 POST_Attribute_Null(d => d.modulo);
680 }
681 [TestMethod, TestCategory(TypeName)]
683 {
684 POST_WithValue(d => d.modulo, Double.MaxValue, true);
685 POST_WithValue(d => d.modulo, TestSuite_Distribution<T>.HighPrecisionValue, true);
686 POST_WithValue(d => d.modulo, TestSuite_Distribution<T>.SmallPositiveDoubleValue, true);
687 }
688 [TestMethod, TestCategory(TypeName)]
690 {
691 // Start of forbidden domain
692 POST_WithValue(d => d.modulo, 0d, false);
693 // Forbidden Special Values
694 POST_WithValue(d => d.modulo, Double.PositiveInfinity, false);
695 POST_WithValue(d => d.modulo, Double.NaN, false);
696 }
697 #endregion modulo
698
699 #region interpolate
700 // Nothing to test on post, Booleans are pretty simple
701 #endregion interpolate
702 #endregion POST
703
704 #region PUT
705 #region modulo
706 [TestMethod, TestCategory(TypeName)]
708 {
709 PUT_Attribute_Null(d => d.modulo);
710 }
711 [TestMethod, TestCategory(TypeName)]
713 {
714 PUT_WithValue(d => d.modulo, 1234.56789, true);
715 }
716 #endregion modulo
717
718 #region interpolate
719 [TestMethod, TestCategory(TypeName)]
721 {
722 PUT_WithValue(d => d.interpolate, !TestResource.interpolate, true);
723 }
724 #endregion interpolate
725 #endregion PUT
726 }
727
729 [TestClass]
731 {
732 private const string TypeName = "Distribution";
733
734 // Constants used for boundary testing
735 public const double LargePostiveDoubleValue = 1e100;
736 public const double SmallPositiveDoubleValue = 1e-100;
737 public const double LargeNegativeDoubleValue = -1e100;
738 public const double SmallNegativeDoubleValue = -1e-100;
739 public const double HighPrecisionValue = Math.PI / 1E12;
740
741 public override void AdditionalValidResourceTests(T posted) =>
743
744 #region POST
745 #region modulo
746 [TestMethod, TestCategory(TypeName)]
748 {
749 POST_Attribute_Null(d => d.modulo);
750 }
751 [TestMethod, TestCategory(TypeName)]
753 {
754 POST_WithValue(d => d.modulo, HighPrecisionValue, true);
755 POST_WithValue(d => d.modulo, Double.MaxValue, true);
756 POST_WithValue(d => d.modulo, SmallPositiveDoubleValue, true);
757 }
758 [TestMethod, TestCategory(TypeName)]
760 {
761 // Start of forbidden domain
762 POST_WithValue(d => d.modulo, 0d, false);
763 // Forbidden Special Values
764 POST_WithValue(d => d.modulo, Double.PositiveInfinity, false);
765 POST_WithValue(d => d.modulo, Double.NaN, false);
766 }
767 #endregion modulo
768 #endregion POST
769 }
770 #endregion Abstract Base Test Classes
771}
Tests for a stored resource collection which do not require an instance of that resource to be define...
virtual T TestResource
The resource used for all unit tests that require a valid prepared but unPOSTed resource.
Exposes the various sample CSV files as strings.
Definition Samples.CSV.cs:9
static string CustomFrequencyDistribution_Data
static string CustomSeasonalityDistribution_Data
static string CustomSeverityDistribution_Data
Exposes sample resource objects, with built-in methods for injecting dependencies.
Definition Samples.cs:14
IInjectableResource< NegativeBinomialDistribution > Distribution_NegativeBinomialDistribution
IInjectableResource< CustomSeasonalityDistribution > Distribution_CustomSeasonalityDistribution
IInjectableResource< PoissonDistribution > Distribution_PoissonDistribution
IInjectableResource< NormalDistribution > Distribution_NormalDistribution
IInjectableResource< LogNormalDistribution > Distribution_LogNormalDistribution
IInjectableResource< CustomSeverityDistribution > Distribution_CustomSeverityDistribution
IInjectableResource< UniformDistribution > Distribution_UniformDistribution
IInjectableResource< ParametricLossSet > LossSet_ParametricLossSet
IInjectableResource< ParetoDistribution > Distribution_ParetoDistribution
IInjectableResource< UniformIntDistribution > Distribution_UniformIntDistribution
IInjectableResource< DiracDistribution > Distribution_DiracDistribution
IInjectableResource< BinomialDistribution > Distribution_BinomialDistribution
IInjectableResource< CustomFrequencyDistribution > Distribution_CustomFrequencyDistribution
Includes tests that affect all types of CustomDistribution. Because these have a data endpoint,...
override IResourceCollection< IDistribution > collection_source
static void Test_Distribution_Simulatable(Distribution posted)
Helper method that asserts that a distribution can be included in a layer_view and simulated without ...
static bool IsFrequencyDistributionSafeToSimulate(IDiscreteDistribution frequencyDistribution)
We should not attempt to simulate a frequency distribution that might generate a huge number of occur...
static double MaxSafeFrequencyDistributionMean
An number chosen to avoid testing frequency distributions whose mean is too large,...
override IInjectableResource< BinomialDistribution > TestInjectableResource
override IInjectableResource< CustomFrequencyDistribution > TestInjectableResource
override IInjectableResource< CustomSeasonalityDistribution > TestInjectableResource
override IInjectableResource< CustomSeverityDistribution > TestInjectableResource
override IInjectableResource< DiracDistribution > TestInjectableResource
override IInjectableResource< LogNormalDistribution > TestInjectableResource
override IInjectableResource< NegativeBinomialDistribution > TestInjectableResource
override IInjectableResource< NormalDistribution > TestInjectableResource
override IInjectableResource< ParetoDistribution > TestInjectableResource
override IInjectableResource< PoissonDistribution > TestInjectableResource
override IInjectableResource< UniformDistribution > TestInjectableResource
override IInjectableResource< UniformIntDistribution > TestInjectableResource
Includes tests that affect all types of Distribution.
override void AdditionalValidResourceTests(T posted)
Deriving classes can optionally override this function to perform additional validation on every succ...
A helper class containing default skip dates.
Definition SkipUntil.cs:66
static void Validation(string ticket=null)
Skip a test due to a validation-related issue, possibly with no insight into when this issue is likel...
Class used in unit tests to mark tests as skipped by using Assert.Inconclusive() method.
Definition SkipUntil.cs:14
static void Indefinitely(string ticket=null)
Skip the specified test.
Definition SkipUntil.cs:54
Describes a collection of resources which can be listed.
API methods / requests made available to the user.
static readonly ResourceCollection< IDistribution > Distributions
The collection of Distributions on the server.
Abstract representation of a distribution, used for parametric loss sets.
Custom Distribution that allows the user to upload CSV data. Can be treated as a Discrete or Continuo...
Custom Distribution that describes a parametric loss set's frequency.
Custom Distribution that describes a parametric loss set's seasonality.
Custom Distribution that describes a parametric loss set's severity.
Representation of a Parametric loss set.
T Unposted
The unPOSTed resource definition.
Represents any distribution that is continuous. With a continuous probability distribution,...
Represents any distribution that is discrete. With a discrete probability distribution,...