Skip to content

Commit

Permalink
Merge pull request #155 from SainsburyWellcomeCentre/issue-153
Browse files Browse the repository at this point in the history
Ensure unit tests check for indirect references
  • Loading branch information
glopesdev authored Oct 13, 2023
2 parents c886090 + ca1d1d3 commit cc1c896
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Aeon.Foraging/Aeon.Foraging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageTags>Bonsai Rx Project Aeon Foraging</PackageTags>
<TargetFramework>net472</TargetFramework>
<VersionPrefix>0.1.0</VersionPrefix>
<VersionSuffix>build230921</VersionSuffix>
<VersionSuffix>build231007</VersionSuffix>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Aeon.Foraging/LinearDepletion.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<Expression xsi:type="Combinator">
<Combinator xsi:type="aeon:PrependOnce" />
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="Aeon.Acquisition:DistanceTravelled.bonsai">
<Expression xsi:type="IncludeWorkflow" Path="Aeon.Foraging:DistanceTravelled.bonsai">
<Gain>1</Gain>
</Expression>
<Expression xsi:type="MulticastSubject">
Expand Down
2 changes: 1 addition & 1 deletion src/Aeon.Foraging/RandomDepletion.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<Expression xsi:type="Combinator">
<Combinator xsi:type="aeon:PrependOnce" />
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="Aeon.Acquisition:DistanceTravelled.bonsai">
<Expression xsi:type="IncludeWorkflow" Path="Aeon.Foraging:DistanceTravelled.bonsai">
<Gain>1</Gain>
</Expression>
<Expression xsi:type="MulticastSubject">
Expand Down
2 changes: 1 addition & 1 deletion src/Aeon.Foraging/TimeSpentOnWheel.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<Property Name="Threshold" />
<Property Name="LowPass" />
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="Aeon.Acquisition:WheelMovement.bonsai">
<Expression xsi:type="IncludeWorkflow" Path="Aeon.Foraging:WheelMoving.bonsai">
<LowPass>5</LowPass>
<Threshold>0.0005</Threshold>
</Expression>
Expand Down
10 changes: 10 additions & 0 deletions src/Aeon.Tests/AssertWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ public static void CanBuildEmbeddedResources(Assembly assembly)
workflowBuilder.Workflow.Convert(builder =>
{
var workflowElement = ExpressionBuilder.GetWorkflowElement(builder);
if (workflowElement is IncludeWorkflowBuilder includeWorkflow)
{
var pathComponents = includeWorkflow.Path.Split(':');
var assembly = Assembly.Load(pathComponents[0]);
var resourceName = string.Join(ExpressionHelper.MemberSeparator, pathComponents);
Assert.IsNotNull(
assembly.GetManifestResourceStream(resourceName),
$"Embedded workflow: {name}. Missing resource name: {resourceName}");
}

if (workflowElement.GetType().Name != nameof(SpinnakerCapture) &&
workflowElement.GetType().Name != nameof(PylonCapture) &&
#pragma warning disable CS0612 // Type or member is obsolete
Expand Down

0 comments on commit cc1c896

Please sign in to comment.