Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
7.0.x
6.0.x
3.1.x

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: |
8.0.x
6.0.x

# Finds the latest release and increases the version
- name: Get next version
Expand Down
3 changes: 1 addition & 2 deletions src/Blazor.Diagrams/Blazor.Diagrams.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" />
<PacakgeReference Include="Brutal.Dev.StrongNameSigner" PrivateAssets="All" />
<PackageReference Include="Brutal.Dev.StrongNameSigner" PrivateAssets="All" />
<!-- Reference the SvgPathProperties that we already strong name signed -->
<Reference Include="SvgPathProperties" PrivateAssets="All">
<HintPath>..\..\packages\svgpathproperties\1.1.2\lib\netstandard2.0\SvgPathProperties.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
27 changes: 13 additions & 14 deletions tests/Blazor.Diagrams.Core.Tests/Anchors/DynamicAnchorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Blazor.Diagrams.Core.Geometry;
using Blazor.Diagrams.Core.Models;
using Blazor.Diagrams.Core.Positions;
using FluentAssertions;
using Xunit;

namespace Blazor.Diagrams.Core.Tests.Anchors;
Expand Down Expand Up @@ -37,7 +36,7 @@ public void GetPosition_ShouldReturnNull_WhenNodesSizeIsNull()
var position = anchor1.GetPosition(link);

// Assert
position.Should().BeNull();
Assert.Null(position);
}

[Fact]
Expand Down Expand Up @@ -72,9 +71,9 @@ public void GetPosition_ShouldReturnClosestPositionToOtherNodesCenter_WhenRouteI
var position = anchor1.GetPosition(link);

// Assert
position.Should().NotBeNull();
position!.X.Should().Be(220);
position.Y.Should().Be(95);
Assert.NotNull(position);
Assert.Equal(220,position!.X);
Assert.Equal(95, position.Y);
}

[Fact]
Expand Down Expand Up @@ -109,9 +108,9 @@ public void GetPosition_ShouldReturnClosestPositionToOtherNodesCenterWithOffset_
var position = anchor1.GetPosition(link);

// Assert
position.Should().NotBeNull();
position!.X.Should().Be(230);
position.Y.Should().Be(85);
Assert.NotNull(position);
Assert.Equal(230, position!.X);
Assert.Equal(85, position.Y);
}

[Fact]
Expand Down Expand Up @@ -149,9 +148,9 @@ public void GetPosition_ShouldReturnClosestPositionToFirstVertex_WhenRouteIsNotE
});

// Assert
position.Should().NotBeNull();
position!.X.Should().Be(220);
position.Y.Should().Be(125);
Assert.NotNull(position);
Assert.Equal(220, position!.X);
Assert.Equal(125, position.Y);
}

[Fact]
Expand Down Expand Up @@ -189,8 +188,8 @@ public void GetPosition_ShouldReturnClosestPositionToLastVertex_WhenRouteIsNotEm
});

// Assert
position.Should().NotBeNull();
position!.X.Should().Be(300);
position.Y.Should().Be(120);
Assert.NotNull(position);
Assert.Equal(300, position!.X);
Assert.Equal(120, position.Y);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Blazor.Diagrams.Core.Anchors;
using Blazor.Diagrams.Core.Geometry;
using Blazor.Diagrams.Core.Models;
using FluentAssertions;
using Moq;
using Xunit;

Expand All @@ -27,8 +26,8 @@ public void GetPlainPosition_ShouldReturnNodeCenter()

// Assert
var center = node.GetBounds()!.Center;
position.X.Should().Be(center.X);
position.Y.Should().Be(center.Y);
Assert.Equal(center.X, position.X);
Assert.Equal(center.Y, position.Y);
}

[Fact]
Expand All @@ -43,7 +42,7 @@ public void GetPosition_ShouldReturnNull_WhenNodeSizeIsNull()
var position = anchor.GetPosition(link);

// Assert
position.Should().BeNull();
Assert.Null(position);
}

[Fact]
Expand All @@ -67,8 +66,8 @@ public void GetPosition_ShouldUseRouteToFindOtherPositionForIntersection_WhenSou

// Assert
var line = args.Single();
line.Start.Should().BeEquivalentTo(route[0]);
line.End.Should().BeEquivalentTo(node.GetBounds()!.Center);
Assert.Equal(route[0],line.Start);
Assert.Equal(node.GetBounds()!.Center, line.End);
}

[Fact]
Expand All @@ -93,8 +92,8 @@ public void GetPosition_ShouldUseRouteToFindOtherPositionForIntersection_WhenTar

// Assert
var line = args.Single();
line.Start.Should().BeEquivalentTo(route[^1]);
line.End.Should().BeEquivalentTo(node.GetBounds()!.Center);
Assert.Equal(route[^1],line.Start);
Assert.Equal(node.GetBounds()!.Center,line.End);
}

[Fact]
Expand All @@ -120,8 +119,8 @@ public void GetPosition_ShouldCallOtherGetPlainPosition_WhenNoRoute()

// Assert
var line = args.Single();
line.Start.Should().BeEquivalentTo(pt);
line.End.Should().BeEquivalentTo(node.GetBounds()!.Center);
Assert.Equal(pt,line.Start);
Assert.Equal(node.GetBounds()!.Center, line.End);
}

[Fact]
Expand All @@ -145,7 +144,7 @@ public void GetPosition_ShouldReturnNull_WhenOtherPositionIsNull()
var position = source.GetPosition(link);

// Assert
position.Should().BeNull();
Assert.Null(position);
}

private class CustomNodeModel : NodeModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Blazor.Diagrams.Core.Anchors;
using Blazor.Diagrams.Core.Geometry;
using Blazor.Diagrams.Core.Models;
using FluentAssertions;
using Moq;
using Xunit;

Expand All @@ -26,8 +25,8 @@ public void GetPlainPosition_ShouldReturnMiddlePosition()

// Assert
var mp = port.MiddlePosition;
position.X.Should().Be(mp.X);
position.Y.Should().Be(mp.Y);
Assert.Equal(mp.X, position.X);
Assert.Equal(mp.Y, position.Y);
}

[Fact]
Expand All @@ -47,7 +46,7 @@ public void GetPosition_ShouldReturnNull_WhenPortNotInitialized()
var position = anchor.GetPosition(link);

// Assert
position.Should().BeNull();
Assert.Null(position);
}

[Fact]
Expand All @@ -72,8 +71,8 @@ public void GetPosition_ShouldReturnMiddlePosition_WhenMiddleIfNoMarker()

// Assert
var mp = port.MiddlePosition;
position.X.Should().Be(mp.X);
position.Y.Should().Be(mp.Y);
Assert.Equal(mp.X, position.X);
Assert.Equal(mp.Y, position.Y);
}

[Theory]
Expand Down Expand Up @@ -106,8 +105,8 @@ public void GetPosition_ShouldReturnAlignmentBasedPosition_WhenUseShapeAndAlignm
var position = anchor.GetPosition(link)!;

// Assert
position.X.Should().Be(x);
position.Y.Should().Be(y);
Assert.Equal(x, position.X);
Assert.Equal(y, position.Y);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Assert.Equal(y, position.Y);
Assert.Equal(y, position.Y);

Removing trailing spaces.

}

[Theory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Blazor.Diagrams.Core.Geometry;
using Blazor.Diagrams.Core.Models;
using Blazor.Diagrams.Core.Options;
using FluentAssertions;
using Moq;
using Xunit;

Expand Down Expand Up @@ -79,7 +78,7 @@ public void Behavior_ShouldTriggerMoved()
new PointerEventArgs(150, 150, 0, 0, false, false, false, 0, 0, 0, 0, 0, 0, string.Empty, true));

// Assert
movedTrigger.Should().BeTrue();
Assert.True(movedTrigger);
}

[Fact]
Expand All @@ -99,7 +98,7 @@ public void Behavior_ShouldNotTriggerMoved_WhenMovableDidntMove()
new PointerEventArgs(150, 150, 0, 0, false, false, false, 0, 0, 0, 0, 0, 0, string.Empty, true));

// Assert
movedTrigger.Should().BeFalse();
Assert.False(movedTrigger);
}

[Fact]
Expand Down
Loading
Loading