diff --git a/Directory.Packages.props b/Directory.Packages.props
index b7c44146..3a60fecb 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -21,7 +21,6 @@
-
@@ -33,4 +32,4 @@
-
\ No newline at end of file
+
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/GraphQLClientExceptionHandling.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/GraphQLClientExceptionHandling.cs
index de6a4286..0c5b70f5 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/GraphQLClientExceptionHandling.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/GraphQLClientExceptionHandling.cs
@@ -1,7 +1,8 @@
using System.ComponentModel;
+using FluentAssertions;
using GraphQL;
using GraphQL.Client.Http;
-using Shouldly;
+
using Speckle.Newtonsoft.Json;
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Inputs;
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs
index 617257e9..271ac703 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs
@@ -1,5 +1,5 @@
using FluentAssertions;
-using Shouldly;
+
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Inputs;
using Speckle.Sdk.Api.GraphQL.Models;
@@ -29,7 +29,7 @@ public Task DisposeAsync()
public async Task ActiveUserGet()
{
var res = await Sut.Get();
- res.ShouldNotBeNull();
+ res.Should().NotBeNull();
res!.id.Should().Be(_testUser.Account.userInfo.id);
}
@@ -49,7 +49,7 @@ public async Task ActiveUserUpdate()
var res = await Sut.Update(new UserUpdateInput(name: NEW_NAME, bio: NEW_BIO, company: NEW_COMPANY));
- res.ShouldNotBeNull();
+ res.Should().NotBeNull();
res.id.Should().Be(_testUser.Account.userInfo.id);
res.name.Should().Be(NEW_NAME);
res.company.Should().Be(NEW_COMPANY);
@@ -64,14 +64,14 @@ public async Task ActiveUserGetProjects()
var res = await Sut.GetProjects();
- res.items.ShouldContain(x => x.id == p1.id);
- res.items.ShouldContain(x => x.id == p2.id);
+ res.items.Should().Contain(x => x.id == p1.id);
+ res.items.Should().Contain(x => x.id == p2.id);
res.items.Count.Should().Be(2);
}
[Fact]
public async Task ActiveUserGetProjects_NoAuth()
{
- await Should.ThrowAsync(async () => await Fixtures.Unauthed.ActiveUser.GetProjects());
+ await FluentActions.Invoking(async () => await Fixtures.Unauthed.ActiveUser.GetProjects()).Should().ThrowAsync();
}
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs
index ed20057e..0ebf4fb0 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs
@@ -1,4 +1,5 @@
-using Shouldly;
+using FluentAssertions;
+
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Inputs;
using Speckle.Sdk.Api.GraphQL.Models;
@@ -34,7 +35,7 @@ public async Task Get()
{
var comment = await Sut.Get(_comment.id, _project.id);
- comment.ShouldNotBeNull();
+ comment.Should().NotBeNull();
comment.id.Should().Be(_comment.id);
comment.authorId.Should().Be(_testUser.Account.userInfo.id);
}
@@ -44,19 +45,17 @@ public async Task GetProjectComments()
{
var comments = await Sut.GetProjectComments(_project.id);
- comments.ShouldNotBeNull();
+ comments.Should().NotBeNull();
comments.items.Count.Should().Be(1);
comments.totalCount.Should().Be(1);
Comment comment = comments.items[0];
- comment.ShouldNotBeNull();
+ comment.Should().NotBeNull();
comment.authorId.Should().Be(_testUser.Account.userInfo.id);
- comment.ShouldSatisfyAllConditions(
- () => comment.id.Should().Be(_comment.id),
- () => comment.authorId.Should().Be(_comment.authorId),
- () => comment.archived.Should().Be(false),
- () => comment.createdAt.Should().Be(_comment.createdAt)
- );
+ comment.id.Should().Be(_comment.id);
+comment.authorId.Should().Be(_comment.authorId);
+ comment.archived.Should().Be(false);
+ comment.createdAt.Should().Be(_comment.createdAt);
}
[Fact]
@@ -65,7 +64,7 @@ public async Task MarkViewed()
await Sut.MarkViewed(new(_comment.id, _project.id));
var res = await Sut.Get(_comment.id, _project.id);
- res.viewedAt.ShouldNotBeNull();
+ res.viewedAt.Should().NotBeNull();
}
[Fact]
@@ -91,13 +90,11 @@ public async Task Edit()
var editedComment = await Sut.Edit(input);
- editedComment.ShouldNotBeNull();
- editedComment.ShouldSatisfyAllConditions(
- () => editedComment.id.Should().Be(_comment.id),
- () => editedComment.authorId.Should().Be(_comment.authorId),
- () => editedComment.createdAt.Should().Be(_comment.createdAt),
- () => editedComment.updatedAt.Should().BeGreaterThanOrEqualTo(_comment.updatedAt)
- );
+ editedComment.Should().NotBeNull();
+ editedComment.id.Should().Be(_comment.id);
+ editedComment.authorId.Should().Be(_comment.authorId);
+ editedComment.createdAt.Should().Be(_comment.createdAt);
+ editedComment.updatedAt.Should().BeOnOrAfter(_comment.updatedAt);
}
[Fact]
@@ -109,7 +106,7 @@ public async Task Reply()
var editedComment = await Sut.Reply(input);
- editedComment.ShouldNotBeNull();
+ editedComment.Should().NotBeNull();
}
private async Task CreateComment()
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs
index 822fcb6e..a6655442 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs
@@ -1,4 +1,5 @@
-using Shouldly;
+
+using FluentAssertions;
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Enums;
using Speckle.Sdk.Api.GraphQL.Inputs;
@@ -34,42 +35,36 @@ public async Task ModelCreate_Throws_InvalidInput(string name)
CreateModelInput input = new(name, null, _project.id);
// Act & Assert
- var ex = await Should.ThrowAsync(async () => await Sut.Create(input));
+ var ex = await FluentActions.Invoking(async () => await Sut.Create(input)).Should().ThrowAsync();
- ex.InnerExceptions.ShouldHaveSingleItem();
- ex.InnerExceptions[0].Should().BeOfType();
+ ex.WithInnerExceptionExactly();
}
[Fact]
public async Task ModelGet_Throws_NoAuth()
{
// Act & Assert
- var ex = await Should.ThrowAsync(
+ var ex = await FluentActions.Invoking(
async () => await Fixtures.Unauthed.Model.Get(_model.id, _project.id)
- );
+ ).Should().ThrowAsync();
- ex.InnerExceptions.ShouldHaveSingleItem();
- ex.InnerExceptions[0].Should().BeOfType();
+ ex.WithInnerExceptionExactly();
}
[Fact]
public async Task ModelGet_Throws_NonExistentModel()
{
// Act & Assert
- var ex = await Should.ThrowAsync(async () => await Sut.Get("non existent model", _project.id));
-
- ex.InnerExceptions.ShouldHaveSingleItem();
- ex.InnerExceptions[0].Should().BeOfType();
+ var ex = await FluentActions.Invoking(async () => await Sut.Get("non existent model", _project.id)).Should().ThrowAsync();
+ ex.WithInnerExceptionExactly();
}
[Fact]
public async Task ModelGet_Throws_NonExistentProject()
{
// Act & Assert
- var ex = await Should.ThrowAsync(async () => await Sut.Get(_model.id, "non existent project"));
-
- ex.InnerExceptions.ShouldHaveSingleItem();
- ex.InnerExceptions[0].Should().BeOfType();
+ var ex = await FluentActions.Invoking(async () => await Sut.Get(_model.id, "non existent project")).Should().ThrowAsync();
+ ex.WithInnerExceptionExactly();
}
[Fact]
@@ -79,10 +74,8 @@ public async Task ModelUpdate_Throws_NonExistentModel()
UpdateModelInput input = new("non-existent model", "MY new name", "MY new desc", _project.id);
// Act & Assert
- var ex = await Should.ThrowAsync(async () => await Sut.Update(input));
-
- ex.InnerExceptions.ShouldHaveSingleItem();
- ex.InnerExceptions[0].Should().BeOfType();
+ var ex = await FluentActions.Invoking(async () => await Sut.Update(input)).Should().ThrowAsync();
+ ex.WithInnerExceptionExactly();
}
[Fact]
@@ -92,10 +85,8 @@ public async Task ModelUpdate_Throws_NonExistentProject()
UpdateModelInput input = new(_model.id, "MY new name", "MY new desc", "non-existent project");
// Act & Assert
- var ex = await Should.ThrowAsync(async () => await Sut.Update(input));
-
- ex.InnerExceptions.ShouldHaveSingleItem();
- ex.InnerExceptions[0].Should().BeOfType();
+ var ex = await FluentActions.Invoking(async () => await Sut.Update(input)).Should().ThrowAsync();
+ ex.WithInnerExceptionExactly();
}
[Fact]
@@ -105,10 +96,8 @@ public async Task ModelUpdate_Throws_NonAuthProject()
UpdateModelInput input = new(_model.id, "MY new name", "MY new desc", _project.id);
// Act & Assert
- var ex = await Should.ThrowAsync(async () => await Fixtures.Unauthed.Model.Update(input));
-
- ex.InnerExceptions.ShouldHaveSingleItem();
- ex.InnerExceptions[0].Should().BeOfType();
+ var ex = await FluentActions.Invoking(async () => await Fixtures.Unauthed.Model.Update(input)).Should().ThrowAsync();
+ ex.WithInnerExceptionExactly();
}
[Fact]
@@ -121,9 +110,7 @@ public async Task ModelDelete_Throws_NoAuth()
await Sut.Delete(input);
// Act & Assert
- var ex = await Should.ThrowAsync(async () => await Sut.Delete(input));
-
- ex.InnerExceptions.ShouldHaveSingleItem();
- ex.InnerExceptions[0].Should().BeOfType();
+ var ex = await FluentActions.Invoking(async () => await Sut.Delete(input)).Should().ThrowAsync();
+ ex.WithInnerExceptionExactly();
}
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs
index 7292c9bf..337f4ce7 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs
@@ -1,5 +1,5 @@
using FluentAssertions;
-using Shouldly;
+
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Inputs;
using Speckle.Sdk.Api.GraphQL.Models;
@@ -41,8 +41,8 @@ public async Task ModelCreate(string name, string? description)
Model result = await Sut.Create(input);
// Assert
- result.ShouldNotBeNull();
- result.id.ShouldNotBeNull();
+ result.Should().NotBeNull();
+ result.id.Should().NotBeNull();
result.name.Should().ContainEquivalentOf(input.name);
result.description.Should().Be(input.description);
}
@@ -115,13 +115,11 @@ public async Task ModelDelete()
await Sut.Delete(input);
// Assert: Ensure fetching the deleted model throws an exception
- var getEx = await Should.ThrowAsync(() => Sut.Get(_model.id, _project.id));
- getEx.InnerExceptions.ShouldHaveSingleItem();
- getEx.InnerExceptions[0].Should().BeOfType();
+ var getEx = await FluentActions.Invoking(() => Sut.Get(_model.id, _project.id)).Should().ThrowAsync();
+ getEx.WithInnerExceptionExactly();
// Assert: Ensure deleting the non-existing model again throws an exception
- var delEx = await Should.ThrowAsync(() => Sut.Delete(input));
- delEx.InnerExceptions.ShouldHaveSingleItem();
- delEx.InnerExceptions[0].Should().BeOfType();
+ var delEx = await FluentActions.Invoking(() => Sut.Delete(input)).Should().ThrowAsync();
+ getEx.WithInnerExceptionExactly();
}
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs
index 64a76c3c..7ecdd2e0 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs
@@ -1,5 +1,5 @@
using System.Threading.Tasks;
-using Shouldly;
+using FluentAssertions;
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Resources;
using Speckle.Sdk.Credentials;
@@ -24,7 +24,7 @@ public async Task OtherUserGet_Should_ReturnCorrectUser()
{
var res = await Sut.Get(_testData.userInfo.id);
- res.ShouldNotBeNull();
+ res.Should().NotBeNull();
res!.name.Should().Be(_testData.userInfo.name);
}
@@ -41,7 +41,7 @@ public async Task UserSearch_Should_ReturnMatchingUser()
{
var res = await Sut.UserSearch(_testData.userInfo.email, 25);
- res.items.ShouldHaveSingleItem();
+ res.items.Should().ContainSingle();
res.items[0].id.Should().Be(_testData.userInfo.id);
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs
index 05f457e6..f729a9af 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs
@@ -1,5 +1,5 @@
using FluentAssertions;
-using Shouldly;
+
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Inputs;
using Speckle.Sdk.Api.GraphQL.Models;
@@ -36,12 +36,11 @@ public async Task ProjectInviteCreate_InvalidInput_ShouldThrowSpeckleGraphQLExce
{
var input = new ProjectInviteCreateInput(email, role, serverRole, userId);
- var exception = await Should.ThrowAsync(async () =>
+ var exception = await FluentActions.Invoking(async () =>
{
await Sut.Create(_project.id, input);
- });
+ }).Should().ThrowAsync();
- exception.InnerExceptions.Should().ContainSingle();
- exception.InnerExceptions[0].Should().BeOfType();
+ exception.WithInnerExceptionExactly();
}
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs
index 35ed2ceb..6b8a7914 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs
@@ -1,6 +1,6 @@
using System.Linq;
using System.Threading.Tasks;
-using Shouldly;
+using FluentAssertions;
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL;
using Speckle.Sdk.Api.GraphQL.Inputs;
@@ -46,9 +46,9 @@ public async Task ProjectInviteCreate_ByEmail()
var invite = invites.First(i => i.projectId == res.id);
res.id.Should().Be(_project.id);
- res.invitedTeam.ShouldHaveSingleItem();
+ res.invitedTeam.Should().ContainSingle();
invite.user!.id.Should().Be(_invitee.Account.userInfo.id);
- invite.token.ShouldNotBeNull();
+ invite.token.Should().NotBeNull();
}
[Fact]
@@ -58,7 +58,7 @@ public async Task ProjectInviteCreate_ByUserId()
var res = await _inviter.ProjectInvite.Create(_project.id, input);
res.id.Should().Be(_project.id);
- res.invitedTeam.ShouldHaveSingleItem();
+ res.invitedTeam.Should().ContainSingle();
res.invitedTeam[0].user!.id.Should().Be(_invitee.Account.userInfo.id);
}
@@ -67,10 +67,8 @@ public async Task ProjectInviteGet()
{
var collaborator = await _invitee.ProjectInvite.Get(_project.id, _createdInvite.token).NotNull();
- collaborator.ShouldSatisfyAllConditions(
- () => collaborator.inviteId.Should().Be(_createdInvite.inviteId),
- () => collaborator.user!.id.Should().Be(_createdInvite.user!.id)
- );
+ collaborator.inviteId.Should().Be(_createdInvite.inviteId);
+ collaborator.user!.id.Should().Be(_createdInvite.user!.id);
}
[Fact]
@@ -90,7 +88,7 @@ public async Task ProjectInviteUse_MemberAdded()
var teamMembers = project.team.Select(c => c.user.id).ToArray();
var expectedTeamMembers = new[] { _inviter.Account.userInfo.id, _invitee.Account.userInfo.id };
- teamMembers.Should().Be(expectedTeamMembers, ignoreOrder: true);
+ teamMembers.Should().BeEquivalentTo(expectedTeamMembers);
}
[Fact]
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs
index ad7ca433..47ab0faf 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs
@@ -1,4 +1,5 @@
-using Shouldly;
+
+using FluentAssertions;
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL;
using Speckle.Sdk.Api.GraphQL.Enums;
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs
index 87acbcd9..8c28f3fa 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs
@@ -1,6 +1,6 @@
using System.Threading.Tasks;
using FluentAssertions;
-using Shouldly;
+
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Enums;
using Speckle.Sdk.Api.GraphQL.Inputs;
@@ -47,11 +47,11 @@ ProjectVisibility visibility
var result = await Sut.Create(input);
// Assert
- result.ShouldNotBeNull();
- result.id.ShouldNotBeNullOrWhiteSpace();
+ result.Should().NotBeNull();
+ result.id.Should().NotBeNullOrWhiteSpace();
result.name.Should().Be(input.name);
result.description.Should().Be(input.description ?? string.Empty);
- result.visibility.Should().Be(input.visibility.ShouldNotBeNull());
+ input.visibility.Should().NotBeNull();
}
[Fact]
@@ -98,9 +98,8 @@ public async Task ProjectDelete_Should_DeleteProjectSuccessfully()
await Sut.Delete(toDelete.id);
// Assert
- var exception = await Should.ThrowAsync(
+ await FluentActions.Invoking(
async () => await Sut.Get(toDelete.id)
- );
- exception.ShouldNotBeNull();
+ ).Should().ThrowAsync();
}
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs
index 3366c33f..8ad940c6 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs
@@ -1,5 +1,5 @@
using FluentAssertions;
-using Shouldly;
+
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Enums;
using Speckle.Sdk.Api.GraphQL.Inputs;
@@ -47,10 +47,10 @@ public async Task UserProjectsUpdated_SubscriptionIsCalled()
await Task.Delay(WAIT_PERIOD); // Give time for subscription to be triggered
- subscriptionMessage.ShouldNotBeNull();
+ subscriptionMessage.Should().NotBeNull();
subscriptionMessage!.id.Should().Be(created.id);
subscriptionMessage.type.Should().Be(UserProjectsUpdatedMessageType.ADDED);
- subscriptionMessage.project.ShouldNotBeNull();
+ subscriptionMessage.project.Should().NotBeNull();
}
[Fact]
@@ -68,10 +68,10 @@ public async Task ProjectModelsUpdated_SubscriptionIsCalled()
await Task.Delay(WAIT_PERIOD); // Give time for subscription to be triggered
- subscriptionMessage.ShouldNotBeNull();
+ subscriptionMessage.Should().NotBeNull();
subscriptionMessage!.id.Should().Be(created.id);
subscriptionMessage.type.Should().Be(ProjectModelsUpdatedMessageType.CREATED);
- subscriptionMessage.model.ShouldNotBeNull();
+ subscriptionMessage.model.Should().NotBeNull();
}
[Fact]
@@ -89,10 +89,10 @@ public async Task ProjectUpdated_SubscriptionIsCalled()
await Task.Delay(WAIT_PERIOD); // Give time for subscription to be triggered
- subscriptionMessage.ShouldNotBeNull();
+ subscriptionMessage.Should().NotBeNull();
subscriptionMessage!.id.Should().Be(created.id);
subscriptionMessage.type.Should().Be(ProjectUpdatedMessageType.UPDATED);
- subscriptionMessage.project.ShouldNotBeNull();
+ subscriptionMessage.project.Should().NotBeNull();
}
[Fact]
@@ -109,10 +109,10 @@ public async Task ProjectVersionsUpdated_SubscriptionIsCalled()
await Task.Delay(WAIT_PERIOD); // Give time for subscription to be triggered
- subscriptionMessage.ShouldNotBeNull();
+ subscriptionMessage.Should().NotBeNull();
subscriptionMessage!.id.Should().Be(created);
subscriptionMessage.type.Should().Be(ProjectVersionsUpdatedMessageType.CREATED);
- subscriptionMessage.version.ShouldNotBeNull();
+ subscriptionMessage.version.Should().NotBeNull();
}
[Fact]
@@ -130,9 +130,9 @@ public async Task ProjectCommentsUpdated_SubscriptionIsCalled()
await Task.Delay(WAIT_PERIOD); // Give time for subscription to be triggered
- subscriptionMessage.ShouldNotBeNull();
+ subscriptionMessage.Should().NotBeNull();
subscriptionMessage!.id.Should().Be(created.id);
subscriptionMessage.type.Should().Be(ProjectCommentsUpdatedMessageType.CREATED);
- subscriptionMessage.comment.ShouldNotBeNull();
+ subscriptionMessage.comment.Should().NotBeNull();
}
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs
index b9946044..2c2b2104 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs
@@ -1,5 +1,5 @@
using FluentAssertions;
-using Shouldly;
+
using Speckle.Sdk.Api;
using Speckle.Sdk.Api.GraphQL.Inputs;
using Speckle.Sdk.Api.GraphQL.Models;
@@ -104,10 +104,10 @@ public async Task VersionDelete()
await Sut.Delete(input);
- var getEx = await Should.ThrowAsync(async () => await Sut.Get(_version.id, _project.id));
- getEx.InnerExceptions.ShouldHaveSingleItem().Should().BeOfType();
+ var getEx = await FluentActions.Invoking(async () => await Sut.Get(_version.id, _project.id)).Should().ThrowAsync();
+ getEx.WithInnerExceptionExactly();
- var delEx = await Should.ThrowAsync(async () => await Sut.Delete(input));
- delEx.InnerExceptions.ShouldHaveSingleItem().Should().BeOfType();
+ var delEx = await FluentActions.Invoking(async () => await Sut.Delete(input)).Should().ThrowAsync();
+ delEx.WithInnerExceptionExactly();
}
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/Credentials/UserServerInfoTests.cs b/tests/Speckle.Sdk.Tests.Integration/Credentials/UserServerInfoTests.cs
index 9a244432..58554d3f 100644
--- a/tests/Speckle.Sdk.Tests.Integration/Credentials/UserServerInfoTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/Credentials/UserServerInfoTests.cs
@@ -2,7 +2,7 @@
using FluentAssertions;
using GraphQL.Client.Http;
using Microsoft.Extensions.DependencyInjection;
-using Shouldly;
+
using Speckle.Sdk.Api.GraphQL.Models;
using Speckle.Sdk.Credentials;
using Xunit;
@@ -27,7 +27,7 @@ public async Task IsFrontEnd2True()
.ServiceProvider.GetRequiredService()
.GetServerInfo(new("https://app.speckle.systems/"));
- result.ShouldNotBeNull();
+ result.Should().NotBeNull();
result.frontend2.Should().BeTrue();
}
@@ -38,7 +38,7 @@ public async Task IsFrontEnd2False()
.ServiceProvider.GetRequiredService()
.GetServerInfo(new("https://speckle.xyz/"));
- result.ShouldNotBeNull();
+ result.Should().NotBeNull();
result.frontend2.Should().BeFalse();
}
@@ -53,9 +53,9 @@ public async Task GetServerInfo_ExpectFail_CantPing()
{
Uri serverUrl = new(_acc.serverInfo.url);
- await Should.ThrowAsync(
+ await FluentActions.Invoking(
async () => await Fixtures.ServiceProvider.GetRequiredService().GetServerInfo(serverUrl)
- );
+ ).Should().ThrowAsync();
}
[Fact]
@@ -63,9 +63,9 @@ public async Task GetServerInfo_ExpectFail_NoServer()
{
Uri serverUrl = new("http://invalidserver.local");
- await Should.ThrowAsync(
+ await FluentActions.Invoking(
async () => await Fixtures.ServiceProvider.GetRequiredService().GetServerInfo(serverUrl)
- );
+ ).Should().ThrowAsync();
}
[Fact]
@@ -88,21 +88,21 @@ public async Task GetUserInfo_ExpectFail_NoServer()
{
Uri serverUrl = new("http://invalidserver.local");
- await Should.ThrowAsync(
+ await FluentActions.Invoking(
async () => await Fixtures.ServiceProvider.GetRequiredService().GetUserInfo("", serverUrl)
- );
+ ).Should().ThrowAsync();
}
[Fact]
public async Task GetUserInfo_ExpectFail_NoUser()
{
Uri serverUrl = new(_acc.serverInfo.url);
+ await FluentActions.Invoking(
- await Should.ThrowAsync(
async () =>
await Fixtures
.ServiceProvider.GetRequiredService()
.GetUserInfo("Bearer 08913c3c1e7ac65d779d1e1f11b942a44ad9672ca9", serverUrl)
- );
+ ).Should().ThrowAsync();
}
}
diff --git a/tests/Speckle.Sdk.Tests.Integration/MemoryTransportTests.cs b/tests/Speckle.Sdk.Tests.Integration/MemoryTransportTests.cs
index 585c027c..cc5c4bd6 100644
--- a/tests/Speckle.Sdk.Tests.Integration/MemoryTransportTests.cs
+++ b/tests/Speckle.Sdk.Tests.Integration/MemoryTransportTests.cs
@@ -2,7 +2,7 @@
using System.Reflection;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
-using Shouldly;
+
using Speckle.Sdk.Api;
using Speckle.Sdk.Host;
using Speckle.Sdk.Models;
@@ -63,15 +63,15 @@ public async Task SendAndReceiveObjectWithBlobs()
blobPaths.Count.Should().Be(3);
var objectBlobs = receivedObject["blobs"] as IList