Skip to content

Commit 88e8cab

Browse files
authored
WI00856225 - Remove FluentAssertions from Blazor.Diagrams.Core.Tests
* FluentAssertion removed from chunk1 files * FluentAssertion removed from chunk2 files * Final FluentAssertion removed from chunk3 files * Updated build.xml and release.xml to .net8 version * updated build.xml for .net7 version * Spelling change of PackageReference * <HintPath> removed form Blazor.Diagram.csproj * changes made in build.yml and Blazor.Diagram.csproj * removed net7.0 from Directory.Build.props * debugging * changes made in Directory.Build.props * Removal of trailing spaces * Spaces and warnings removed * actions/upload-artifact version changed from v3 to v4 * extra spaces removed
1 parent b9819c0 commit 88e8cab

26 files changed

+335
-360
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
uses: actions/setup-dotnet@v3
2222
with:
2323
dotnet-version: |
24+
8.0.x
2425
6.0.x
25-
3.1.x
2626
2727
- name: Install dependencies
2828
run: dotnet restore
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Upload packages
3838
if: matrix.configuration == 'Release'
39-
uses: actions/upload-artifact@v3
39+
uses: actions/upload-artifact@v4
4040
with:
4141
name: package
4242
path: /home/runner/work/Blazor.Diagrams/Blazor.Diagrams/src/Blazor.Diagrams/bin/Release/*.nupkg

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
- name: Setup dotnet
2323
uses: actions/setup-dotnet@v3
2424
with:
25-
dotnet-version: '6.0.x'
25+
dotnet-version: |
26+
8.0.x
27+
6.0.x
2628
2729
# Finds the latest release and increases the version
2830
- name: Get next version

src/Blazor.Diagrams.Core/Blazor.Diagrams.Core.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
</None>
2929
</ItemGroup>
3030

31-
<ItemGroup>
32-
<PackageReference Include="SvgPathProperties" />
33-
<PackageReference Include="Brutal.Dev.StrongNameSigner" PrivateAssets="All"/>
34-
</ItemGroup>
31+
<ItemGroup>
32+
<PackageReference Include="SvgPathProperties" />
33+
<PackageReference Include="Brutal.Dev.StrongNameSigner" PrivateAssets="All"/>
34+
</ItemGroup>
3535

3636
</Project>

src/Blazor.Diagrams/Blazor.Diagrams.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
<ItemGroup>
2121
<PackageReference Include="Microsoft.AspNetCore.Components" />
2222
<PackageReference Include="Microsoft.AspNetCore.Components.Web" />
23-
<PacakgeReference Include="Brutal.Dev.StrongNameSigner" PrivateAssets="All" />
23+
<PackageReference Include="Brutal.Dev.StrongNameSigner" PrivateAssets="All" />
2424
<!-- Reference the SvgPathProperties that we already strong name signed -->
25-
<Reference Include="SvgPathProperties" PrivateAssets="All">
26-
<HintPath>..\..\packages\svgpathproperties\1.1.2\lib\netstandard2.0\SvgPathProperties.dll</HintPath>
27-
</Reference>
25+
<PackageReference Include="SvgPathProperties" PrivateAssets="All" />
2826
</ItemGroup>
2927

3028
<ItemGroup>

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFrameworks>net8.0;net7.0;net6.0;</TargetFrameworks>
3+
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
44
<Nullable>enable</Nullable>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>

tests/Blazor.Diagrams.Core.Tests/Anchors/DynamicAnchorTests.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Blazor.Diagrams.Core.Geometry;
33
using Blazor.Diagrams.Core.Models;
44
using Blazor.Diagrams.Core.Positions;
5-
using FluentAssertions;
65
using Xunit;
76

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

3938
// Assert
40-
position.Should().BeNull();
39+
Assert.Null(position);
4140
}
4241

4342
[Fact]
@@ -72,9 +71,9 @@ public void GetPosition_ShouldReturnClosestPositionToOtherNodesCenter_WhenRouteI
7271
var position = anchor1.GetPosition(link);
7372

7473
// Assert
75-
position.Should().NotBeNull();
76-
position!.X.Should().Be(220);
77-
position.Y.Should().Be(95);
74+
Assert.NotNull(position);
75+
Assert.Equal(220,position!.X);
76+
Assert.Equal(95, position.Y);
7877
}
7978

8079
[Fact]
@@ -109,9 +108,9 @@ public void GetPosition_ShouldReturnClosestPositionToOtherNodesCenterWithOffset_
109108
var position = anchor1.GetPosition(link);
110109

111110
// Assert
112-
position.Should().NotBeNull();
113-
position!.X.Should().Be(230);
114-
position.Y.Should().Be(85);
111+
Assert.NotNull(position);
112+
Assert.Equal(230, position!.X);
113+
Assert.Equal(85, position.Y);
115114
}
116115

117116
[Fact]
@@ -149,9 +148,9 @@ public void GetPosition_ShouldReturnClosestPositionToFirstVertex_WhenRouteIsNotE
149148
});
150149

151150
// Assert
152-
position.Should().NotBeNull();
153-
position!.X.Should().Be(220);
154-
position.Y.Should().Be(125);
151+
Assert.NotNull(position);
152+
Assert.Equal(220, position!.X);
153+
Assert.Equal(125, position.Y);
155154
}
156155

157156
[Fact]
@@ -189,8 +188,8 @@ public void GetPosition_ShouldReturnClosestPositionToLastVertex_WhenRouteIsNotEm
189188
});
190189

191190
// Assert
192-
position.Should().NotBeNull();
193-
position!.X.Should().Be(300);
194-
position.Y.Should().Be(120);
191+
Assert.NotNull(position);
192+
Assert.Equal(300, position!.X);
193+
Assert.Equal(120, position.Y);
195194
}
196195
}

tests/Blazor.Diagrams.Core.Tests/Anchors/ShapeIntersectionAnchorTests.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Blazor.Diagrams.Core.Anchors;
44
using Blazor.Diagrams.Core.Geometry;
55
using Blazor.Diagrams.Core.Models;
6-
using FluentAssertions;
76
using Moq;
87
using Xunit;
98

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

2827
// Assert
2928
var center = node.GetBounds()!.Center;
30-
position.X.Should().Be(center.X);
31-
position.Y.Should().Be(center.Y);
29+
Assert.Equal(center.X, position.X);
30+
Assert.Equal(center.Y, position.Y);
3231
}
3332

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

4544
// Assert
46-
position.Should().BeNull();
45+
Assert.Null(position);
4746
}
4847

4948
[Fact]
@@ -67,8 +66,8 @@ public void GetPosition_ShouldUseRouteToFindOtherPositionForIntersection_WhenSou
6766

6867
// Assert
6968
var line = args.Single();
70-
line.Start.Should().BeEquivalentTo(route[0]);
71-
line.End.Should().BeEquivalentTo(node.GetBounds()!.Center);
69+
Assert.Equal(route[0],line.Start);
70+
Assert.Equal(node.GetBounds()!.Center, line.End);
7271
}
7372

7473
[Fact]
@@ -93,8 +92,8 @@ public void GetPosition_ShouldUseRouteToFindOtherPositionForIntersection_WhenTar
9392

9493
// Assert
9594
var line = args.Single();
96-
line.Start.Should().BeEquivalentTo(route[^1]);
97-
line.End.Should().BeEquivalentTo(node.GetBounds()!.Center);
95+
Assert.Equal(route[^1],line.Start);
96+
Assert.Equal(node.GetBounds()!.Center,line.End);
9897
}
9998

10099
[Fact]
@@ -120,8 +119,8 @@ public void GetPosition_ShouldCallOtherGetPlainPosition_WhenNoRoute()
120119

121120
// Assert
122121
var line = args.Single();
123-
line.Start.Should().BeEquivalentTo(pt);
124-
line.End.Should().BeEquivalentTo(node.GetBounds()!.Center);
122+
Assert.Equal(pt,line.Start);
123+
Assert.Equal(node.GetBounds()!.Center, line.End);
125124
}
126125

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

147146
// Assert
148-
position.Should().BeNull();
147+
Assert.Null(position);
149148
}
150149

151150
private class CustomNodeModel : NodeModel

tests/Blazor.Diagrams.Core.Tests/Anchors/SinglePortAnchorTests.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Blazor.Diagrams.Core.Anchors;
22
using Blazor.Diagrams.Core.Geometry;
33
using Blazor.Diagrams.Core.Models;
4-
using FluentAssertions;
54
using Moq;
65
using Xunit;
76

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

2726
// Assert
2827
var mp = port.MiddlePosition;
29-
position.X.Should().Be(mp.X);
30-
position.Y.Should().Be(mp.Y);
28+
Assert.Equal(mp.X, position.X);
29+
Assert.Equal(mp.Y, position.Y);
3130
}
3231

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

4948
// Assert
50-
position.Should().BeNull();
49+
Assert.Null(position);
5150
}
5251

5352
[Fact]
@@ -72,8 +71,8 @@ public void GetPosition_ShouldReturnMiddlePosition_WhenMiddleIfNoMarker()
7271

7372
// Assert
7473
var mp = port.MiddlePosition;
75-
position.X.Should().Be(mp.X);
76-
position.Y.Should().Be(mp.Y);
74+
Assert.Equal(mp.X, position.X);
75+
Assert.Equal(mp.Y, position.Y);
7776
}
7877

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

108107
// Assert
109-
position.X.Should().Be(x);
110-
position.Y.Should().Be(y);
108+
Assert.Equal(x, position.X);
109+
Assert.Equal(y, position.Y);
111110
}
112111

113112
[Theory]
@@ -139,7 +138,7 @@ public void GetPosition_ShouldUsePointAtAngle_WhenUseShapeAndAlignmentIsTrue(Por
139138

140139
// Act
141140
var position = anchor.GetPosition(link)!;
142-
141+
143142
// Assert
144143
shapeMock.Verify(s => s.GetPointAtAngle(angle), Times.Once);
145144
}

tests/Blazor.Diagrams.Core.Tests/Behaviors/DragMovablesBehaviorTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Blazor.Diagrams.Core.Geometry;
44
using Blazor.Diagrams.Core.Models;
55
using Blazor.Diagrams.Core.Options;
6-
using FluentAssertions;
76
using Moq;
87
using Xunit;
98

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

8180
// Assert
82-
movedTrigger.Should().BeTrue();
81+
Assert.True(movedTrigger);
8382
}
8483

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

101100
// Assert
102-
movedTrigger.Should().BeFalse();
101+
Assert.False(movedTrigger);
103102
}
104103

105104
[Fact]

0 commit comments

Comments
 (0)