-
Notifications
You must be signed in to change notification settings - Fork 2
Unit Test Cleanup #1227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit Test Cleanup #1227
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
|
||
namespace HEC.FDA.ModelTest.unittests | ||
{ | ||
[Trait("RunsOn", "Local")] | ||
[Trait("RunsOn", "Remote")] | ||
public class StageDamageShould | ||
{ | ||
|
||
|
@@ -256,32 +256,13 @@ private Inventory CreateInventory() | |
return inventory; | ||
} | ||
|
||
|
||
[Fact] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we have a similar test somewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not necessarily. Truth is this test hadn't been run in a long time, and the case it was testing throws an exception way before it looks like it did in this test. A lot of processing is kicked off right in the constructor of IASD. We might reconsider that, because constructors can't fail as gracefully as we can on other methods. For now, this test just isn't useful, and should go. |
||
public void ErrorsShouldStopCompute() | ||
{ | ||
//Arrange | ||
Inventory inventory = CreateInventory(); | ||
ImpactAreaStageDamage impactAreaStageDamage = new ImpactAreaStageDamage(impactAreaID, inventory, hydraulicDataset, String.Empty, usingMockData: true); | ||
List<ImpactAreaStageDamage> impactAreaStageDamageList = new List<ImpactAreaStageDamage>() { impactAreaStageDamage }; | ||
ScenarioStageDamage scenarioStageDamage = new ScenarioStageDamage(impactAreaStageDamageList); | ||
|
||
//Act | ||
//This compute should return a list with count of 0 stage-damage functions - we didnt provide any H&H summary relationships | ||
//so cannot calculate stage frequency, and the compute should check for that | ||
List<UncertainPairedData> nullStageDamage = impactAreaStageDamage.Compute().Item1; | ||
|
||
//Assert | ||
Assert.Equal(0, nullStageDamage.Count); | ||
} | ||
|
||
[Theory] | ||
[InlineData(6)] | ||
public void StructureDetailsShould(double expectedLength) | ||
{ | ||
//Arrange | ||
Inventory inventory = CreateInventory(); | ||
ImpactAreaStageDamage impactAreaStageDamage = new ImpactAreaStageDamage(impactAreaID, inventory, hydraulicDataset, String.Empty, usingMockData: true); | ||
ImpactAreaStageDamage impactAreaStageDamage = new ImpactAreaStageDamage(impactAreaID, inventory, hydraulicDataset, String.Empty, graphicalFrequency: stageFrequency, usingMockData: true); | ||
List<ImpactAreaStageDamage> impactAreaStageDamageList = new List<ImpactAreaStageDamage>() { impactAreaStageDamage }; | ||
ScenarioStageDamage scenarioStageDamage = new ScenarioStageDamage(impactAreaStageDamageList); | ||
Dictionary<int, string> iaNames = new(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we reconsider whether this test is helpful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely. Where did the expected values come from?