-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GSAGH-499: test to increase coverage
- Loading branch information
1 parent
e1b3d85
commit ae6ac0d
Showing
6 changed files
with
62 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
GsaGHTests/2_GooWrappers/PersistentParameters/GsaModalDynamicParameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
| ||
using System.Linq; | ||
|
||
using Grasshopper.Kernel; | ||
|
||
using GsaGH; | ||
using GsaGH.Parameters; | ||
using GsaGH.Parameters.Enums; | ||
|
||
using GsaGHTests.Components.Analysis; | ||
using GsaGHTests.Helpers; | ||
|
||
using OasysGH.Components; | ||
|
||
using Xunit; | ||
|
||
namespace GsaGHTests.GooWrappers { | ||
[Collection("GrasshopperFixture collection")] | ||
public class GsaModalDynamicParameterTests { | ||
|
||
[Fact] | ||
public void GsaModalDynamicParameterPreferredCastTest() { | ||
GH_OasysComponent comp = CreateAnalysisTaskTests.CreateAnalysisTaskComponent(ModeCalculationMethod.FrquencyRange); | ||
object output = ComponentTestHelper.GetOutput(comp); | ||
var param = new GsaModalDynamicParameter(); | ||
param.AddVolatileData(new Grasshopper.Kernel.Data.GH_Path(0), 0, output); | ||
Assert.NotNull(param.VolatileData.AllData(false).First()); | ||
Assert.Contains("FrquencyRange", ComponentTestHelper.GetOutput(param).ToString()); | ||
} | ||
|
||
[Fact] | ||
public void ToStringTest() { | ||
GH_OasysComponent comp = CreateAnalysisTaskTests.CreateAnalysisTaskComponent(ModeCalculationMethod.FrquencyRange); | ||
object output = ComponentTestHelper.GetOutput(comp); | ||
var param = new GsaModalDynamicParameter(); | ||
param.AddVolatileData(new Grasshopper.Kernel.Data.GH_Path(0), 0, output); | ||
Assert.NotNull(param.VolatileData.AllData(false).First()); | ||
} | ||
|
||
[Fact] | ||
public void GsaModalDynamicParameterPreferredCastErrorTest() { | ||
int i = 0; | ||
var param = new GsaModalDynamicParameter(); | ||
param.AddVolatileData(new Grasshopper.Kernel.Data.GH_Path(0), 0, i); | ||
Assert.False(param.VolatileData.AllData(false).First().IsValid); | ||
Assert.Single(param.RuntimeMessages(GH_RuntimeMessageLevel.Error)); | ||
} | ||
|
||
[Fact] | ||
public void ParameterThenPluginInfoValueShouldBeValid() { | ||
GH_OasysComponent comp = CreateModalDynamicParameterByFrquencyRangeTest.ComponentMother(); | ||
var output = (GsaModalDynamicGoo)ComponentTestHelper.GetOutput(comp); | ||
Assert.Equal(PluginInfo.Instance, output.PluginInfo); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters