Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8.0.x
6.0.x
3.1.x

- name: Install dependencies
run: dotnet restore
Expand Down
4 changes: 1 addition & 3 deletions src/Blazor.Diagrams/Blazor.Diagrams.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Web" />
<PacakgeReference Include="Brutal.Dev.StrongNameSigner" PrivateAssets="All" />

Choose a reason for hiding this comment

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

Suggested change
<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>
<PackageReference Include="SvgPathProperties" PrivateAssets="All" />

Choose a reason for hiding this comment

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

Let's fix the spacing here.

Copy link
Author

Choose a reason for hiding this comment

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

spacing fixed

</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
Expand Down
1 change: 0 additions & 1 deletion tests/Blazor.Diagrams.Tests/Blazor.Diagrams.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

<ItemGroup>
<PackageReference Include="bunit" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="Moq" />
Expand Down
5 changes: 2 additions & 3 deletions tests/Blazor.Diagrams.Tests/Components/DiagramCursorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Blazor.Diagrams.Components;
using Blazor.Diagrams.Core.Geometry;
using Bunit;
using FluentAssertions;
using Xunit;

namespace Blazor.Diagrams.Core.Tests.Behaviors
Expand All @@ -24,7 +23,7 @@ public void Behavior_WhenPanningOptionIsAllowed_CursorShouldBeGrab()
var diagramCanvas = cut.Find(".diagram-canvas");

// Assert
diagramCanvas.ToMarkup().Should().Contain("cursor: grab; cursor: -webkit-grab;");
Assert.Contains("cursor: grab; cursor: -webkit-grab;", diagramCanvas.ToMarkup());
}

[Fact]
Expand All @@ -43,7 +42,7 @@ public void Behavior_WhenPanningOptionIsNotAllowed_CursorShouldBeDefault()
var canvasStyle = diagramCanvas.GetStyle().CssText;

// Assert
canvasStyle.Should().Contain("cursor: default");
Assert.Contains("cursor: default", canvasStyle);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Blazor.Diagrams.Core.Models;
using Blazor.Diagrams.Tests.TestComponents;
using Bunit;
using FluentAssertions;
using Microsoft.AspNetCore.Components.Web;
using System.Threading.Tasks;
using Xunit;
Expand Down Expand Up @@ -76,9 +75,9 @@ public void ShouldRerender_WhenVertexIsRefreshed()
.Add(n => n.BlazorDiagram, new BlazorDiagram()));

// Assert
cut.RenderCount.Should().Be(1);
Assert.Equal(1, cut.RenderCount);
vertex.Refresh();
cut.RenderCount.Should().Be(2);
Assert.Equal(2, cut.RenderCount);
}

[Fact]
Expand All @@ -104,8 +103,8 @@ public async Task ShouldDeleteItselfAndRefreshParent_WhenDoubleClicked()
await cut.Find("circle").DoubleClickAsync(new MouseEventArgs());

// Assert
link.Vertices.Should().BeEmpty();
linkRefreshes.Should().Be(1);
Assert.Empty(link.Vertices);
Assert.Equal(1,linkRefreshes);
}

[Fact]
Expand Down
9 changes: 4 additions & 5 deletions tests/Blazor.Diagrams.Tests/Components/NodeWidgetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

using Bunit;

using FluentAssertions;

using Xunit;

Expand All @@ -26,11 +25,11 @@ public void DefaultNodeWidget_ShouldHaveSingleClassAndNoPorts_WhenItHasNoPortsAn

// Assert
var content = cut.Find("div.default-node");
content.ClassList.Should().ContainSingle();
content.ClassList[0].Should().Be("default-node");
content.TextContent.Trim().Should().Be("Title");
Assert.Single(content.ClassList);
Assert.Equal("default-node", content.ClassList[0]);
Assert.Equal("Title", content.TextContent.Trim());

var ports = cut.FindComponents<PortRenderer>();
ports.Should().BeEmpty();
Assert.Empty(ports);
}
}
11 changes: 5 additions & 6 deletions tests/Blazor.Diagrams.Tests/DiagramTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Blazor.Diagrams.Components;
using Blazor.Diagrams.Core.Models;
using Blazor.Diagrams.Core.Models.Base;
using FluentAssertions;
using Microsoft.AspNetCore.Components;
using Xunit;

Expand All @@ -20,7 +19,7 @@ public void GetComponentForModel_ShouldReturnComponentType_WhenModelTypeWasRegis
var componentType = diagram.GetComponent<NodeModel>();

// Assert
componentType.Should().Be(typeof(NodeWidget));
Assert.Equal(typeof(NodeWidget), componentType);
}

[Fact]
Expand All @@ -33,7 +32,7 @@ public void GetComponentForModel_ShouldReturnNull_WhenModelTypeWasNotRegistered(
var componentType = diagram.GetComponent<NodeModel>();

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

[Fact]
Expand All @@ -47,7 +46,7 @@ public void GetComponentForModel_ShouldReturnComponentType_WhenInheritedModelTyp
var componentType = diagram.GetComponent<CustomModel>();

// Assert
componentType.Should().Be(typeof(NodeWidget));
Assert.Equal(typeof(NodeWidget), componentType);
}

[Fact]
Expand All @@ -62,7 +61,7 @@ public void GetComponentForModel_ShouldReturnSpecificComponentType_WhenInherited
var componentType = diagram.GetComponent<CustomModel>();

// Assert
componentType.Should().Be(typeof(CustomWidget));
Assert.Equal(typeof(CustomWidget), componentType);
}

[Fact]
Expand All @@ -76,7 +75,7 @@ public void GetComponentForModel_ShouldReturnNull_WhenCheckSubclassesIsFalse()
var componentType = diagram.GetComponent<CustomModel>(false);

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

private class CustomModel : Model { }
Expand Down
2 changes: 1 addition & 1 deletion tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0;</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
Expand Down
Loading