diff --git a/backend/FwLite/FwDataMiniLcmBridge.Tests/FwDataMiniLcmBridge.Tests.csproj b/backend/FwLite/FwDataMiniLcmBridge.Tests/FwDataMiniLcmBridge.Tests.csproj index e3b798195..f2ff05e5d 100644 --- a/backend/FwLite/FwDataMiniLcmBridge.Tests/FwDataMiniLcmBridge.Tests.csproj +++ b/backend/FwLite/FwDataMiniLcmBridge.Tests/FwDataMiniLcmBridge.Tests.csproj @@ -21,7 +21,7 @@ - + all diff --git a/backend/FwLite/FwDataMiniLcmBridge.Tests/UpdateComplexFormsTests.cs b/backend/FwLite/FwDataMiniLcmBridge.Tests/UpdateComplexFormsTests.cs index 89ad04933..acc4c96bf 100644 --- a/backend/FwLite/FwDataMiniLcmBridge.Tests/UpdateComplexFormsTests.cs +++ b/backend/FwLite/FwDataMiniLcmBridge.Tests/UpdateComplexFormsTests.cs @@ -33,8 +33,8 @@ await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Add(e => e.Components, ComplexFormComponent.FromEntries(complexForm, component))); var entry = await _api.GetEntry(complexForm.Id); - entry.ShouldNotBeNull(); - entry!.Components.Should() + entry.Should().NotBeNull(); + entry.Components.Should() .ContainSingle(c => c.ComponentEntryId == component.Id && c.ComplexFormEntryId == complexForm.Id); } @@ -62,8 +62,8 @@ public async Task CanRemoveComponentFromExistingEntry() await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Remove(e => e.Components, 0)); var entry = await _api.GetEntry(complexForm.Id); - entry.ShouldNotBeNull(); - entry!.Components.Should().BeEmpty(); + entry.Should().NotBeNull(); + entry.Components.Should().BeEmpty(); } [Fact] @@ -91,8 +91,8 @@ public async Task CanChangeComponentId() await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Set(e => e.Components[0].ComponentEntryId, component2.Id)); var entry = await _api.GetEntry(complexForm.Id); - entry.ShouldNotBeNull(); - var complexFormComponent = entry!.Components.Should().ContainSingle().Subject; + entry.Should().NotBeNull(); + var complexFormComponent = entry.Components.Should().ContainSingle().Subject; complexFormComponent.ComponentEntryId.Should().Be(component2.Id); } @@ -126,8 +126,8 @@ public async Task CanChangeComponentSenseId() await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Set(e => e.Components[0].ComponentSenseId, component2SenseId)); var entry = await _api.GetEntry(complexForm.Id); - entry.ShouldNotBeNull(); - var complexFormComponent = entry!.Components.Should().ContainSingle().Subject; + entry.Should().NotBeNull(); + var complexFormComponent = entry.Components.Should().ContainSingle().Subject; complexFormComponent.ComponentEntryId.Should().Be(component2.Id); complexFormComponent.ComponentSenseId.Should().Be(component2SenseId); } @@ -162,8 +162,8 @@ public async Task CanChangeComponentSenseIdToNull() await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Set(e => e.Components[0].ComponentSenseId, null)); var entry = await _api.GetEntry(complexForm.Id); - entry.ShouldNotBeNull(); - entry!.Components.Should() + entry.Should().NotBeNull(); + entry.Components.Should() .ContainSingle(c => c.ComponentEntryId == component2.Id && c.ComponentSenseId == null); } @@ -192,8 +192,8 @@ public async Task CanChangeComplexFormId() await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Set(e => e.Components[0].ComplexFormEntryId, complexForm2.Id)); var entry = await _api.GetEntry(complexForm2.Id); - entry.ShouldNotBeNull(); - var complexFormComponent = entry!.Components.Should().ContainSingle().Subject; + entry.Should().NotBeNull(); + var complexFormComponent = entry.Components.Should().ContainSingle().Subject; complexFormComponent.ComponentEntryId.Should().Be(component1.Id); } @@ -207,8 +207,8 @@ await _api.UpdateEntry(component.Id, new UpdateObjectInput().Add(e => e.ComplexForms, ComplexFormComponent.FromEntries(complexForm, component))); var entry = await _api.GetEntry(component.Id); - entry.ShouldNotBeNull(); - entry!.ComplexForms.Should() + entry.Should().NotBeNull(); + entry.ComplexForms.Should() .ContainSingle(c => c.ComponentEntryId == component.Id && c.ComplexFormEntryId == complexForm.Id); } @@ -236,8 +236,8 @@ await _api.CreateEntry(new() await _api.UpdateEntry(component.Id, new UpdateObjectInput().Remove(e => e.ComplexForms, 0)); var entry = await _api.GetEntry(component.Id); - entry.ShouldNotBeNull(); - entry!.ComplexForms.Should().BeEmpty(); + entry.Should().NotBeNull(); + entry.ComplexForms.Should().BeEmpty(); } [Fact] @@ -265,8 +265,8 @@ await _api.CreateEntry(new() await _api.UpdateEntry(component1.Id, new UpdateObjectInput().Set(e => e.ComplexForms[0].ComplexFormEntryId, complexForm2.Id)); var entry = await _api.GetEntry(component1.Id); - entry.ShouldNotBeNull(); - var complexFormComponent = entry!.ComplexForms.Should().ContainSingle().Subject; + entry.Should().NotBeNull(); + var complexFormComponent = entry.ComplexForms.Should().ContainSingle().Subject; complexFormComponent.ComplexFormEntryId.Should().Be(complexForm2.Id); } @@ -295,8 +295,8 @@ await _api.CreateEntry(new() await _api.UpdateEntry(component1.Id, new UpdateObjectInput().Set(e => e.ComplexForms[0].ComponentEntryId, component2.Id)); var entry = await _api.GetEntry(component2.Id); - entry.ShouldNotBeNull(); - var complexFormComponent = entry!.ComplexForms.Should().ContainSingle().Subject; + entry.Should().NotBeNull(); + var complexFormComponent = entry.ComplexForms.Should().ContainSingle().Subject; complexFormComponent.ComponentEntryId.Should().Be(component2.Id); complexFormComponent.ComplexFormEntryId.Should().Be(complexFormId); } @@ -337,8 +337,8 @@ await _api.CreateEntry(new() await _api.UpdateEntry(component1.Id, new UpdateObjectInput().Set(e => e.ComplexForms[0].ComponentSenseId, component1SenseId2)); var entry = await _api.GetEntry(component1.Id); - entry.ShouldNotBeNull(); - var complexFormComponent = entry!.ComplexForms.Should().ContainSingle().Subject; + entry.Should().NotBeNull(); + var complexFormComponent = entry.ComplexForms.Should().ContainSingle().Subject; complexFormComponent.ComponentEntryId.Should().Be(componentId1); complexFormComponent.ComponentSenseId.Should().Be(component1SenseId2); } @@ -352,8 +352,8 @@ public async Task CanAddComplexFormType() await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Add(e => e.ComplexFormTypes, complexFormType)); var entry = await _api.GetEntry(complexForm.Id); - entry.ShouldNotBeNull(); - entry!.ComplexFormTypes.Should().ContainSingle(c => c.Id == complexFormType.Id); + entry.Should().NotBeNull(); + entry.ComplexFormTypes.Should().ContainSingle(c => c.Id == complexFormType.Id); } [Fact] @@ -368,8 +368,8 @@ public async Task CanRemoveComplexFormType() await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Remove(e => e.ComplexFormTypes, 0)); var entry = await _api.GetEntry(complexForm.Id); - entry.ShouldNotBeNull(); - entry!.ComplexFormTypes.Should().BeEmpty(); + entry.Should().NotBeNull(); + entry.ComplexFormTypes.Should().BeEmpty(); } [Fact] @@ -381,7 +381,7 @@ public async Task CanChangeComplexFormType() await _api.UpdateEntry(complexForm.Id, new UpdateObjectInput().Set(e => e.ComplexFormTypes[0].Id, complexFormType2.Id)); var entry = await _api.GetEntry(complexForm.Id); - entry.ShouldNotBeNull(); - entry!.ComplexFormTypes.Should().ContainSingle().Which.Id.Should().Be(complexFormType2.Id); + entry.Should().NotBeNull(); + entry.ComplexFormTypes.Should().ContainSingle().Which.Id.Should().Be(complexFormType2.Id); } } diff --git a/backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs b/backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs index deebb645f..021587cfd 100644 --- a/backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs +++ b/backend/FwLite/FwLiteProjectSync.Tests/EntrySyncTests.cs @@ -24,7 +24,7 @@ public async Task CanSyncRandomEntries() var after = await AutoFaker.EntryReadyForCreation(_fixture.CrdtApi, entryId: createdEntry.Id); await EntrySync.Sync(after, createdEntry, _fixture.CrdtApi); var actual = await _fixture.CrdtApi.GetEntry(after.Id); - actual.ShouldNotBeNull(); + actual.Should().NotBeNull(); actual.Should().BeEquivalentTo(after, options => options); } @@ -56,7 +56,7 @@ public async Task CanChangeComplexFormVisSync_Components() await EntrySync.Sync(after, complexForm, _fixture.CrdtApi); var actual = await _fixture.CrdtApi.GetEntry(after.Id); - actual.ShouldNotBeNull(); + actual.Should().NotBeNull(); actual.Should().BeEquivalentTo(after, options => options); } @@ -88,7 +88,7 @@ public async Task CanChangeComplexFormViaSync_ComplexForms() await EntrySync.Sync(after, component, _fixture.CrdtApi); var actual = await _fixture.CrdtApi.GetEntry(after.Id); - actual.ShouldNotBeNull(); + actual.Should().NotBeNull(); actual.Should().BeEquivalentTo(after, options => options); } @@ -102,7 +102,7 @@ public async Task CanChangeComplexFormTypeViaSync() await EntrySync.Sync(after, entry, _fixture.CrdtApi); var actual = await _fixture.CrdtApi.GetEntry(after.Id); - actual.ShouldNotBeNull(); + actual.Should().NotBeNull(); actual.Should().BeEquivalentTo(after, options => options); } } diff --git a/backend/FwLite/FwLiteProjectSync.Tests/FwLiteProjectSync.Tests.csproj b/backend/FwLite/FwLiteProjectSync.Tests/FwLiteProjectSync.Tests.csproj index 1ae1063f4..c988caadc 100644 --- a/backend/FwLite/FwLiteProjectSync.Tests/FwLiteProjectSync.Tests.csproj +++ b/backend/FwLite/FwLiteProjectSync.Tests/FwLiteProjectSync.Tests.csproj @@ -20,7 +20,7 @@ - + diff --git a/backend/FwLite/LcmCrdt.Tests/Changes/ComplexFormTests.cs b/backend/FwLite/LcmCrdt.Tests/Changes/ComplexFormTests.cs index ae9f1a6de..804cacdad 100644 --- a/backend/FwLite/LcmCrdt.Tests/Changes/ComplexFormTests.cs +++ b/backend/FwLite/LcmCrdt.Tests/Changes/ComplexFormTests.cs @@ -17,8 +17,8 @@ public async Task AddComplexFormType() var change = new AddComplexFormTypeChange(complexEntry.Id,complexFormType); await fixture.DataModel.AddChange(Guid.NewGuid(), change); complexEntry = await fixture.Api.GetEntry(complexEntry.Id); - complexEntry.ShouldNotBeNull(); - complexEntry!.ComplexFormTypes.Should().ContainSingle().Which.Id.Should().Be(change.ComplexFormType.Id); + complexEntry.Should().NotBeNull(); + complexEntry.ComplexFormTypes.Should().ContainSingle().Which.Id.Should().Be(change.ComplexFormType.Id); } [Fact] @@ -32,15 +32,15 @@ await fixture.DataModel.AddChange( new AddComplexFormTypeChange(complexEntry.Id, complexFormType) ); complexEntry = await fixture.Api.GetEntry(complexEntry.Id); - complexEntry.ShouldNotBeNull(); - complexEntry!.ComplexFormTypes.Should().ContainSingle().Which.Id.Should().Be(complexFormType.Id); + complexEntry.Should().NotBeNull(); + complexEntry.ComplexFormTypes.Should().ContainSingle().Which.Id.Should().Be(complexFormType.Id); await fixture.DataModel.AddChange( Guid.NewGuid(), new RemoveComplexFormTypeChange(complexEntry.Id, complexFormType.Id) ); complexEntry = await fixture.Api.GetEntry(complexEntry.Id); - complexEntry.ShouldNotBeNull(); - complexEntry!.ComplexFormTypes.Should().BeEmpty(); + complexEntry.Should().NotBeNull(); + complexEntry.ComplexFormTypes.Should().BeEmpty(); } [Fact] @@ -54,13 +54,13 @@ public async Task AddEntryComponent() await fixture.DataModel.AddChange(Guid.NewGuid(), new AddEntryComponentChange(ComplexFormComponent.FromEntries(complexEntry, coatEntry))); await fixture.DataModel.AddChange(Guid.NewGuid(), new AddEntryComponentChange(ComplexFormComponent.FromEntries(complexEntry, rackEntry))); complexEntry = await fixture.Api.GetEntry(complexEntry.Id); - complexEntry.ShouldNotBeNull(); - complexEntry!.Components.Should().ContainSingle(e => e.ComponentEntryId == coatEntry.Id); + complexEntry.Should().NotBeNull(); + complexEntry.Components.Should().ContainSingle(e => e.ComponentEntryId == coatEntry.Id); complexEntry.Components.Should().ContainSingle(e => e.ComponentEntryId == rackEntry.Id); coatEntry = await fixture.Api.GetEntry(coatEntry.Id); - coatEntry.ShouldNotBeNull(); - coatEntry!.ComplexForms.Should().ContainSingle(e => e.ComplexFormEntryId == complexEntry.Id); + coatEntry.Should().NotBeNull(); + coatEntry.ComplexForms.Should().ContainSingle(e => e.ComplexFormEntryId == complexEntry.Id); } [Fact] @@ -73,12 +73,12 @@ public async Task DeleteEntryComponent() await fixture.DataModel.AddChange(Guid.NewGuid(), new AddEntryComponentChange(ComplexFormComponent.FromEntries(complexEntry, coatEntry))); await fixture.DataModel.AddChange(Guid.NewGuid(), new AddEntryComponentChange(ComplexFormComponent.FromEntries(complexEntry, rackEntry))); complexEntry = await fixture.Api.GetEntry(complexEntry.Id); - complexEntry.ShouldNotBeNull(); - var component = complexEntry!.Components.First(); + complexEntry.Should().NotBeNull(); + var component = complexEntry.Components.First(); await fixture.DataModel.AddChange(Guid.NewGuid(), new DeleteChange(component.Id)); complexEntry = await fixture.Api.GetEntry(complexEntry.Id); - complexEntry.ShouldNotBeNull(); - complexEntry!.Components.Should().NotContain(c => c.Id == component.Id); + complexEntry.Should().NotBeNull(); + complexEntry.Components.Should().NotContain(c => c.Id == component.Id); } } diff --git a/backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs b/backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs index 8765d10d3..359edff20 100644 --- a/backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs +++ b/backend/FwLite/LcmCrdt.Tests/DataModelSnapshotTests.cs @@ -89,7 +89,7 @@ public void VerifyIObjectWithIdsMatchAdapterGetObjectTypeName() { foreach (var jsonDerivedType in types) { - var typeDiscriminator = jsonDerivedType.TypeDiscriminator.ShouldBeOfType(); + var typeDiscriminator = jsonDerivedType.TypeDiscriminator.Should().BeOfType().Subject; var obj = Faker.Generate(jsonDerivedType.DerivedType); new MiniLcmCrdtAdapter((IObjectWithId)obj).GetObjectTypeName().Should().Be(typeDiscriminator); } diff --git a/backend/FwLite/LcmCrdt.Tests/JsonPatchEntryRewriteTests.cs b/backend/FwLite/LcmCrdt.Tests/JsonPatchEntryRewriteTests.cs index 74555d06c..b2370c85e 100644 --- a/backend/FwLite/LcmCrdt.Tests/JsonPatchEntryRewriteTests.cs +++ b/backend/FwLite/LcmCrdt.Tests/JsonPatchEntryRewriteTests.cs @@ -17,7 +17,7 @@ public void ChangesFromJsonPatch_AddComponentMakesAddEntryComponentChange() patch.Add(entry => entry.Components, ComplexFormComponent.FromEntries(_entry, componentEntry)); var changes = _entry.ToChanges(patch); var addEntryComponentChange = - changes.Should().ContainSingle().Which.ShouldBeOfType(); + changes.Should().ContainSingle().Which.Should().BeOfType().Subject; addEntryComponentChange.ComplexFormEntryId.Should().Be(_entry.Id); addEntryComponentChange.ComponentEntryId.Should().Be(componentEntry.Id); addEntryComponentChange.ComponentHeadword.Should().Be(componentEntry.Headword()); @@ -81,7 +81,7 @@ public void ChangesFromJsonPatch_AddComplexFormMakesAddEntryComponentChange() patch.Add(entry => entry.ComplexForms, ComplexFormComponent.FromEntries(_entry, componentEntry)); var changes = componentEntry.ToChanges(patch); var addEntryComponentChange = - changes.Should().ContainSingle().Which.ShouldBeOfType(); + changes.Should().ContainSingle().Which.Should().BeOfType().Subject; addEntryComponentChange.ComplexFormEntryId.Should().Be(_entry.Id); addEntryComponentChange.ComponentEntryId.Should().Be(componentEntry.Id); addEntryComponentChange.ComponentHeadword.Should().Be(componentEntry.Headword()); @@ -145,7 +145,7 @@ public void ChangesFromJsonPatch_AddComplexFormTypeMakesAddComplexFormTypeChange patch.Add(entry => entry.ComplexFormTypes, complexFormType); var changes = _entry.ToChanges(patch); var addComplexFormTypeChange = - changes.Should().ContainSingle().Which.ShouldBeOfType(); + changes.Should().ContainSingle().Which.Should().BeOfType().Subject; addComplexFormTypeChange.EntityId.Should().Be(_entry.Id); addComplexFormTypeChange.ComplexFormType.Should().Be(complexFormType); } diff --git a/backend/FwLite/LcmCrdt.Tests/JsonPatchSenseRewriteTests.cs b/backend/FwLite/LcmCrdt.Tests/JsonPatchSenseRewriteTests.cs index 5d639d080..47df869f5 100644 --- a/backend/FwLite/LcmCrdt.Tests/JsonPatchSenseRewriteTests.cs +++ b/backend/FwLite/LcmCrdt.Tests/JsonPatchSenseRewriteTests.cs @@ -47,7 +47,7 @@ public void JsonPatchChangeRewriteDoesNotReturnEmptyPatchChanges() var changes = _sense.ToChanges(_patchDocument).ToArray(); var setPartOfSpeechChange = changes.Should().ContainSingle() - .Subject.ShouldBeOfType(); + .Subject.Should().BeOfType().Subject; setPartOfSpeechChange.EntityId.Should().Be(_sense.Id); setPartOfSpeechChange.PartOfSpeechId.Should().Be(newPartOfSpeechId); } diff --git a/backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj b/backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj index d955b734a..9f03df743 100644 --- a/backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj +++ b/backend/FwLite/LcmCrdt.Tests/LcmCrdt.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/backend/FwLite/LcmCrdt.Tests/SerializationTests.cs b/backend/FwLite/LcmCrdt.Tests/SerializationTests.cs index a5ae0ee6d..52002507f 100644 --- a/backend/FwLite/LcmCrdt.Tests/SerializationTests.cs +++ b/backend/FwLite/LcmCrdt.Tests/SerializationTests.cs @@ -75,8 +75,8 @@ public void CanDeserializeMultiString() Values = { { "en", "test" } } }; var actualMs = JsonSerializer.Deserialize(json); - actualMs.ShouldNotBeNull(); - actualMs!.Values.Should().ContainKey("en"); + actualMs.Should().NotBeNull(); + actualMs.Values.Should().ContainKey("en"); actualMs.Should().BeEquivalentTo(expectedMs); } diff --git a/backend/FwLite/MiniLcm.Tests/BasicApiTestsBase.cs b/backend/FwLite/MiniLcm.Tests/BasicApiTestsBase.cs index 4918969ba..9b1f05144 100644 --- a/backend/FwLite/MiniLcm.Tests/BasicApiTestsBase.cs +++ b/backend/FwLite/MiniLcm.Tests/BasicApiTestsBase.cs @@ -201,8 +201,8 @@ public async Task SearchEntries_MatchesGloss() public async Task GetEntry() { var entry = await Api.GetEntry(Entry1Id); - entry.ShouldNotBeNull(); - entry!.LexemeForm.Values.Should().NotBeEmpty(); + entry.Should().NotBeNull(); + entry.LexemeForm.Values.Should().NotBeEmpty(); var sense = entry.Senses.Should() .NotBeEmpty($"because '{entry.LexemeForm.Values.First().Value}' should have a sense").And.Subject.First(); sense.Gloss.Values.Should().NotBeEmpty(); @@ -275,7 +275,7 @@ public async Task CreateEntry() } ] }); - entry.ShouldNotBeNull(); + entry.Should().NotBeNull(); entry.LexemeForm.Values["en"].Should().Be("Kevin"); entry.LiteralMeaning.Values["en"].Should().Be("Kevin"); entry.CitationForm.Values["en"].Should().Be("Kevin"); diff --git a/backend/FwLite/MiniLcm.Tests/CreateEntryTestsBase.cs b/backend/FwLite/MiniLcm.Tests/CreateEntryTestsBase.cs index 76bb4aedf..37fef2f21 100644 --- a/backend/FwLite/MiniLcm.Tests/CreateEntryTestsBase.cs +++ b/backend/FwLite/MiniLcm.Tests/CreateEntryTestsBase.cs @@ -8,7 +8,7 @@ public abstract class CreateEntryTestsBase : MiniLcmTestBase public async Task CanCreateEntry() { var entry = await Api.CreateEntry(new() { LexemeForm = { { "en", "test" } } }); - entry.ShouldNotBeNull(); + entry.Should().NotBeNull(); entry.LexemeForm.Values.Should().ContainKey("en"); entry.LexemeForm.Values["en"].Should().Be("test"); } @@ -52,7 +52,7 @@ public async Task CanCreate_WithComponentsProperty() ] }); entry = await Api.GetEntry(entry.Id); - entry.ShouldNotBeNull(); + entry.Should().NotBeNull(); entry.Components.Should().ContainSingle(c => c.ComponentEntryId == component.Id); } @@ -77,7 +77,7 @@ public async Task CanCreate_WithComplexFormsProperty() ] }); entry = await Api.GetEntry(entry.Id); - entry.ShouldNotBeNull(); + entry.Should().NotBeNull(); entry.ComplexForms.Should().ContainSingle(c => c.ComplexFormEntryId == complexForm.Id); } @@ -109,11 +109,11 @@ await Api.CreateEntry(new() }); var entry = await Api.GetEntry(component.Id); - entry.ShouldNotBeNull(); + entry.Should().NotBeNull(); entry.ComplexForms.Should().ContainSingle().Which.ComponentSenseId.Should().Be(componentSenseId); entry = await Api.GetEntry(complexFormEntryId); - entry.ShouldNotBeNull(); + entry.Should().NotBeNull(); entry.Components.Should().ContainSingle(c => c.ComplexFormEntryId == complexFormEntryId && c.ComponentEntryId == component.Id && c.ComponentSenseId == componentSenseId); @@ -132,7 +132,7 @@ public async Task CanCreate_WithComplexFormTypesProperty() LexemeForm = { { "en", "test" } }, ComplexFormTypes = [complexFormType] }); entry = await Api.GetEntry(entry.Id); - entry.ShouldNotBeNull(); + entry.Should().NotBeNull(); entry.ComplexFormTypes.Should().ContainSingle(c => c.Id == complexFormType.Id); } } diff --git a/backend/FwLite/MiniLcm.Tests/CustomAssertions.cs b/backend/FwLite/MiniLcm.Tests/CustomAssertions.cs deleted file mode 100644 index 672534804..000000000 --- a/backend/FwLite/MiniLcm.Tests/CustomAssertions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace MiniLcm.Tests; - -public static class CustomAssertions -{ - public static T ShouldNotBeNull([NotNull] this T? actual, string? customMessage = null) - where T : class - { - actual.Should().NotBeNull(customMessage); - return actual ?? throw new InvalidOperationException("ShouldNotBeNull failed"); - } - - public static T ShouldNotBeNull([NotNull] this T? actual, string? customMessage = null) - where T : struct - { - actual.Should().NotBeNull(customMessage); - return actual ?? throw new InvalidOperationException("ShouldNotBeNull failed"); - } - - public static T ShouldBeOfType([NotNull] this object? actual, string? customMessage = null) - { - actual.ShouldNotBeNull(customMessage); - actual.Should().BeOfType(customMessage); - return (T)actual; - } -} diff --git a/backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj b/backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj index 2f08ca0f5..be07e4f4e 100644 --- a/backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj +++ b/backend/FwLite/MiniLcm.Tests/MiniLcm.Tests.csproj @@ -19,7 +19,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs b/backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs index 33b564428..1b5601be2 100644 --- a/backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs +++ b/backend/FwLite/MiniLcm.Tests/MiniLcmTestBase.cs @@ -17,7 +17,7 @@ public abstract class MiniLcmTestBase : IAsyncLifetime public virtual async Task InitializeAsync() { Api = await NewApi(); - Api.ShouldNotBeNull(); + Api.Should().NotBeNull(); } public virtual async Task DisposeAsync() diff --git a/backend/FwLite/MiniLcm.Tests/PartOfSpeechTestsBase.cs b/backend/FwLite/MiniLcm.Tests/PartOfSpeechTestsBase.cs index bd6ef655c..2cbb0514f 100644 --- a/backend/FwLite/MiniLcm.Tests/PartOfSpeechTestsBase.cs +++ b/backend/FwLite/MiniLcm.Tests/PartOfSpeechTestsBase.cs @@ -40,7 +40,7 @@ public async Task Sense_HasPartOfSpeech() var entry = await Api.GetEntries().FirstAsync(e => e.Senses.Any(s => !string.IsNullOrEmpty(s.PartOfSpeech))); var sense = entry.Senses.First(s => !string.IsNullOrEmpty(s.PartOfSpeech)); sense.PartOfSpeech.Should().NotBeNullOrEmpty(); - sense.PartOfSpeechId.ShouldNotBeNull(); + sense.PartOfSpeechId.Should().NotBeNull(); } [Fact] diff --git a/backend/FwLite/MiniLcm.Tests/SemanticDomainTestsBase.cs b/backend/FwLite/MiniLcm.Tests/SemanticDomainTestsBase.cs index 615cadbb2..38b6a5f63 100644 --- a/backend/FwLite/MiniLcm.Tests/SemanticDomainTestsBase.cs +++ b/backend/FwLite/MiniLcm.Tests/SemanticDomainTestsBase.cs @@ -34,7 +34,7 @@ await Api.CreateEntry(new Entry() private async Task GetEntry() { var entry = await Api.GetEntry(_entryId); - entry.ShouldNotBeNull(); + entry.Should().NotBeNull(); return entry; } @@ -54,8 +54,8 @@ public async Task GetSemanticDomains_ReturnsAllSemanticDomains() public async Task Sense_HasSemanticDomains() { var entry = await GetEntry(); - entry.ShouldNotBeNull(); - var sense = entry!.Senses.First(s => s.SemanticDomains.Any()); + entry.Should().NotBeNull(); + var sense = entry.Senses.First(s => s.SemanticDomains.Any()); sense.SemanticDomains.Should().NotBeEmpty(); sense.SemanticDomains.Should().AllSatisfy(sd => { diff --git a/backend/LexBoxApi/GraphQL/ProjectMutations.cs b/backend/LexBoxApi/GraphQL/ProjectMutations.cs index 2f6df4039..b481eb7c6 100644 --- a/backend/LexBoxApi/GraphQL/ProjectMutations.cs +++ b/backend/LexBoxApi/GraphQL/ProjectMutations.cs @@ -26,14 +26,14 @@ public enum CreateProjectResult Requested } - public record CreateProjectResponse(Guid? Id, CreateProjectResult Result); + public record CreateProjectResponse(Guid Id, CreateProjectResult Result); [Error] [Error] [Error] [UseMutationConvention] [RefreshJwt] [VerifiedEmailRequired] - public async Task CreateProject( + public async Task CreateProject( LoggedInContext loggedInContext, IPermissionService permissionService, CreateProjectInput input, diff --git a/backend/Testing/ApiTests/ApiTestBase.cs b/backend/Testing/ApiTests/ApiTestBase.cs index a04a03f0b..cbf22d856 100644 --- a/backend/Testing/ApiTests/ApiTestBase.cs +++ b/backend/Testing/ApiTests/ApiTestBase.cs @@ -67,7 +67,7 @@ public async Task ExecuteGql([StringSyntax("graphql")] string gql, b var response = await HttpClient.PostAsJsonAsync($"{BaseUrl}/api/graphql{jwtParam}", new { query = gql }); if (JwtHelper.TryGetJwtFromLoginResponse(response, out var jwt)) CurrJwt = jwt; var jsonResponse = await response.Content.ReadFromJsonAsync(); - jsonResponse.ShouldNotBeNull($"for query {gql} ({(int)response.StatusCode} ({response.ReasonPhrase}))"); + jsonResponse.Should().NotBeNull($"for query {gql} ({(int)response.StatusCode} ({response.ReasonPhrase}))"); GqlUtils.ValidateGqlErrors(jsonResponse, expectGqlError); if (expectSuccessCode) response.IsSuccessStatusCode.Should().BeTrue($"code was {(int)response.StatusCode} ({response.ReasonPhrase})"); @@ -83,7 +83,7 @@ query projectLastCommit { } } """); - var project = jsonResult?["data"]?["projectByCode"].ShouldBeOfType(); + var project = jsonResult?["data"]?["projectByCode"].Should().BeOfType().Subject; var stringDate = project?["lastCommit"]?.ToString(); return stringDate == null ? null : DateTimeOffset.Parse(stringDate); } diff --git a/backend/Testing/ApiTests/AuthTests.cs b/backend/Testing/ApiTests/AuthTests.cs index 135d0a3ce..33a065e4f 100644 --- a/backend/Testing/ApiTests/AuthTests.cs +++ b/backend/Testing/ApiTests/AuthTests.cs @@ -41,12 +41,12 @@ public async Task TestGqlVerifyDifferentUsers() var query = """query testGetMe { meAuth { id email }}"""; await LoginAs("manager", TestingEnvironmentVariables.DefaultPassword); var manager = await ExecuteGql(query); - manager.ShouldNotBeNull(); + manager.Should().NotBeNull(); manager["data"]!["meAuth"]!["email"]!.ToString().Should().Be("manager@test.com"); await LoginAs("admin", TestingEnvironmentVariables.DefaultPassword); var admin = await ExecuteGql(query); - admin.ShouldNotBeNull(); + admin.Should().NotBeNull(); admin["data"]!["meAuth"]!["email"]!.ToString().Should().Be("admin@test.com"); } diff --git a/backend/Testing/ApiTests/FlexJwtTests.cs b/backend/Testing/ApiTests/FlexJwtTests.cs index d1806de3a..3f3c82108 100644 --- a/backend/Testing/ApiTests/FlexJwtTests.cs +++ b/backend/Testing/ApiTests/FlexJwtTests.cs @@ -35,13 +35,13 @@ public async Task CanGetProjectSpecificToken() //intentionally not using the RefreshResponse class to make sure this test still fails if properties are renamed var json = await response.Content.ReadFromJsonAsync(); var projectToken = json.GetProperty("projectToken").GetString(); - projectToken.ShouldNotBeNullOrEmpty(); + projectToken.Should().NotBeNullOrEmpty(); var user = ParseUserToken(projectToken); user.Projects.Should().ContainSingle(); user.Audience.Should().Be(LexboxAudience.SendAndReceive); var flexToken = json.GetProperty("flexToken").GetString(); - flexToken.ShouldNotBeNullOrEmpty(); + flexToken.Should().NotBeNullOrEmpty(); var flexUser = ParseUserToken(flexToken); flexUser.Projects.Should().BeEmpty(); flexUser.Audience.Should().Be(LexboxAudience.SendAndReceiveRefresh); diff --git a/backend/Testing/ApiTests/GqlMiddlewareTests.cs b/backend/Testing/ApiTests/GqlMiddlewareTests.cs index f6d8fb05e..72074b694 100644 --- a/backend/Testing/ApiTests/GqlMiddlewareTests.cs +++ b/backend/Testing/ApiTests/GqlMiddlewareTests.cs @@ -80,7 +80,7 @@ await Task.WhenAll( // if the user is allowed to view all members var json = await QueryMyProjectsWithMembers(); - json.ShouldNotBeNull(); + json.Should().NotBeNull(); var myProjects = json["data"]!["myProjects"]!.AsArray(); var ids = myProjects.Select(p => p!["id"]!.GetValue()); diff --git a/backend/Testing/ApiTests/NewProjectRaceCondition.cs b/backend/Testing/ApiTests/NewProjectRaceCondition.cs index b9162b641..6dcd30899 100644 --- a/backend/Testing/ApiTests/NewProjectRaceCondition.cs +++ b/backend/Testing/ApiTests/NewProjectRaceCondition.cs @@ -47,11 +47,16 @@ private async Task CreateQueryAndVerifyProject(Guid id) createProjectResponse { id } + errors { + ... on Error { + message + } + } } } """); - var project = response["data"]!["createProject"]!["createProjectResponse"].ShouldBeOfType(); + var project = response["data"]!["createProject"]!["createProjectResponse"].Should().BeOfType().Subject; project["id"]!.GetValue().Should().Be(id.ToString()); // Query a 2nd time to ensure the instability of new repos isn't causing trouble @@ -66,7 +71,7 @@ private async Task CreateQueryAndVerifyProject(Guid id) } """); - project = response["data"]!["projectByCode"].ShouldBeOfType(); + project = response["data"]!["projectByCode"].Should().BeOfType().Subject; project["name"]!.GetValue().Should().Be(name); } } diff --git a/backend/Testing/ApiTests/OrgPermissionTests.cs b/backend/Testing/ApiTests/OrgPermissionTests.cs index 70a036e66..dc8b59873 100644 --- a/backend/Testing/ApiTests/OrgPermissionTests.cs +++ b/backend/Testing/ApiTests/OrgPermissionTests.cs @@ -37,14 +37,14 @@ private async Task QueryOrg(Guid orgId) private static JsonObject GetOrg(JsonObject json) { var org = json["data"]?["orgById"]?.AsObject(); - org.ShouldNotBeNull(); + org.Should().NotBeNull(); return org; } private void MustHaveOneMemberWithEmail(JsonNode org) { org["members"]!.AsArray().Where(m => m?["user"]?["email"]?.GetValue() is { Length: > 0 }) - .ShouldNotBeNullOrEmpty(); + .Should().NotBeNullOrEmpty(); } private void MustNotHaveMemberWithEmail(JsonNode org) { @@ -55,7 +55,7 @@ private void MustNotHaveMemberWithEmail(JsonNode org) private void MustHaveOneMemberWithUsername(JsonNode org) { org["members"]!.AsArray().Where(m => m?["user"]?["username"]?.GetValue() is { Length: > 0 }) - .ShouldNotBeNullOrEmpty(); + .Should().NotBeNullOrEmpty(); } private void MustNotHaveMemberWithUsername(JsonNode org) { @@ -67,7 +67,7 @@ private void MustHaveUserNames(JsonNode org) { org["members"]!.AsArray() .Where(m => m?["user"]?["name"]?.GetValue() is { Length: > 0 }) - .ShouldNotBeNullOrEmpty(); + .Should().NotBeNullOrEmpty(); } private void MustContainUser(JsonNode org, Guid id) @@ -88,7 +88,7 @@ private void MustHaveNonManagers(JsonNode org) { org["members"]!.AsArray() .Where(m => m?["role"]?.GetValue() is not "ADMIN") - .ShouldNotBeNullOrEmpty(); + .Should().NotBeNullOrEmpty(); } [Fact] @@ -113,7 +113,7 @@ public async Task CanNotListOrgsAndListOrgUsers() """, true, false); var error = json["errors"]?.AsArray().First()?.AsObject(); - error.ShouldNotBeNull(); + error.Should().NotBeNull(); error["extensions"]?["code"]?.GetValue().Should().Be("AUTH_NOT_AUTHORIZED"); } @@ -134,7 +134,7 @@ public async Task CanNotListOrgsAndListOrgProjects() """, true, false); var error = json["errors"]?.AsArray().First()?.AsObject(); - error.ShouldNotBeNull(); + error.Should().NotBeNull(); error["extensions"]?["code"]?.GetValue().Should().Be("AUTH_NOT_AUTHORIZED"); } @@ -167,7 +167,7 @@ public async Task OrgMemberCanSeeThemselvesInOrg() { await LoginAs("editor"); var org = GetOrg(await QueryOrg(SeedingData.TestOrgId)); - org.ShouldNotBeNull(); + org.Should().NotBeNull(); MustContainUser(org, SeedingData.EditorId); } @@ -176,7 +176,7 @@ public async Task OrgMemberCanNotSeeMemberEmails() { await LoginAs("editor"); var org = GetOrg(await QueryOrg(SeedingData.TestOrgId)); - org.ShouldNotBeNull(); + org.Should().NotBeNull(); MustHaveUserNames(org); MustNotHaveMemberWithEmail(org); } @@ -186,7 +186,7 @@ public async Task OrgMemberCanNotSeeMemberUsernames() { await LoginAs("editor"); var org = GetOrg(await QueryOrg(SeedingData.TestOrgId)); - org.ShouldNotBeNull(); + org.Should().NotBeNull(); MustHaveUserNames(org); MustNotHaveMemberWithUsername(org); } @@ -203,7 +203,7 @@ public async Task NonMemberCanOnlyQueryManagers() private void MustNotShowConfidentialProjects(JsonNode org) { var projects = org["projects"]!.AsArray(); - projects.ShouldNotBeNullOrEmpty(); + projects.Should().NotBeNullOrEmpty(); projects .Where(p => p?["isConfidential"]?.GetValue() != false) .Should().BeEmpty(); @@ -212,7 +212,7 @@ private void MustNotShowConfidentialProjects(JsonNode org) private void MustContainProject(JsonNode org, Guid projectId) { var projects = org["projects"]!.AsArray(); - projects.ShouldNotBeNullOrEmpty(); + projects.Should().NotBeNullOrEmpty(); projects.Should().Contain(p => p!["id"]!.GetValue() == projectId, $"project id '{projectId}' should exist in: {projects.ToJsonString()}"); } diff --git a/backend/Testing/ApiTests/ProjectPermissionTests.cs b/backend/Testing/ApiTests/ProjectPermissionTests.cs index dab7749f0..4a0bf5c3b 100644 --- a/backend/Testing/ApiTests/ProjectPermissionTests.cs +++ b/backend/Testing/ApiTests/ProjectPermissionTests.cs @@ -56,7 +56,7 @@ ... on Error { private JsonObject GetProject(JsonObject json) { var project = json["data"]!["projectByCode"]?.AsObject(); - project.ShouldNotBeNull(); + project.Should().NotBeNull(); return project; } @@ -132,7 +132,7 @@ public async Task ConfidentialProject_NonMemberCannotSeeProject() await LoginAs("user"); var json = await QueryProject(project.Code, expectGqlError: true); var error = json["errors"]!.AsArray().First()?.AsObject(); - error.ShouldNotBeNull(); + error.Should().NotBeNull(); error["extensions"]?["code"]?.GetValue().Should().Be("AUTH_NOT_AUTHORIZED"); } } diff --git a/backend/Testing/CustomAssertions.cs b/backend/Testing/CustomAssertions.cs deleted file mode 100644 index afcb54652..000000000 --- a/backend/Testing/CustomAssertions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using FluentAssertions; - -namespace Testing; - -public static class CustomAssertions -{ - public static T ShouldNotBeNull([NotNull] this T? actual, string? customMessage = null) - where T : class - { - actual.Should().NotBeNull(customMessage); - return actual ?? throw new InvalidOperationException("ShouldNotBeNull failed"); - } - - public static T ShouldNotBeNull([NotNull] this T? actual, string? customMessage = null) - where T : struct - { - actual.Should().NotBeNull(customMessage); - return actual ?? throw new InvalidOperationException("ShouldNotBeNull failed"); - } - - public static void ShouldNotBeNullOrEmpty([NotNull] this IEnumerable? actual, string? customMessage = null) - { - actual.ShouldNotBeNull(customMessage); - actual.Should().NotBeEmpty(customMessage); - } - - public static T ShouldBeOfType([NotNull] this object? actual, string? customMessage = null) - { - actual.ShouldNotBeNull(customMessage); - actual.Should().BeOfType(customMessage); - return (T)actual; - } -} diff --git a/backend/Testing/Fixtures/IntegrationFixture.cs b/backend/Testing/Fixtures/IntegrationFixture.cs index d17d9afa7..77a1f282a 100644 --- a/backend/Testing/Fixtures/IntegrationFixture.cs +++ b/backend/Testing/Fixtures/IntegrationFixture.cs @@ -16,7 +16,7 @@ public class IntegrationFixture : IAsyncLifetime public static readonly DirectoryInfo TemplateRepo = new(Path.Join(BasePath, "_template-repo_")); public ApiTestBase AdminApiTester { get; private set; } = new(); private string? _adminJwt = null; - public string AdminJwt => _adminJwt.ShouldNotBeNull(); + public string AdminJwt => _adminJwt.Should().NotBeNull().And.Subject; static IntegrationFixture() { diff --git a/backend/Testing/LexCore/LexAuthUserTests.cs b/backend/Testing/LexCore/LexAuthUserTests.cs index 8f93b4475..ed919e901 100644 --- a/backend/Testing/LexCore/LexAuthUserTests.cs +++ b/backend/Testing/LexCore/LexAuthUserTests.cs @@ -151,7 +151,7 @@ public void CanRoundTripFromAuthTicketToAuthTicket() jwtUserOptions ); var actualTicket = JwtTicketDataFormat.ConvertJwtToAuthTicket(jwt, JwtBearerOptions, NullLogger.Instance); - actualTicket.ShouldNotBeNull(); + actualTicket.Should().NotBeNull(); actualTicket.Properties.IssuedUtc.Should().Be(ticket.Properties.IssuedUtc); actualTicket.Properties.ExpiresUtc.Should().Be(ticket.Properties.ExpiresUtc); //order by is because the order isn't important but the assertion fails if the order is different @@ -184,7 +184,7 @@ public void CanParseFromKnownGoodJwt() var outputJwt = tokenHandler.ReadJwtToken(knownGoodJwt); var principal = new ClaimsPrincipal(new ClaimsIdentity(outputJwt.Claims, "Testing")); var newUser = LexAuthUser.FromClaimsPrincipal(principal); - newUser.ShouldNotBeNull(); + newUser.Should().NotBeNull(); newUser.UpdatedDate.Should().Be(0); //old jwt doesn't have updated date or orgs, we're ok with that so we correct the values to make the equivalence work newUser.Orgs = [ new AuthUserOrg(OrgRole.Admin, LexData.SeedingData.TestOrgId) ]; diff --git a/backend/Testing/LexCore/Services/ProjectServiceTest.cs b/backend/Testing/LexCore/Services/ProjectServiceTest.cs index be573cb3f..6accdbbe8 100644 --- a/backend/Testing/LexCore/Services/ProjectServiceTest.cs +++ b/backend/Testing/LexCore/Services/ProjectServiceTest.cs @@ -61,7 +61,7 @@ public async Task CanUpdateProjectLangTags() new(null, "TestProject", "Test", "test2", ProjectType.FLEx, RetentionPolicy.Test, false, null, null)); await _projectService.UpdateProjectLangTags(projectId); var project = await _lexBoxDbContext.Projects.Include(p => p.FlexProjectMetadata).SingleAsync(p => p.Id == projectId); - project.FlexProjectMetadata.ShouldNotBeNull(); + project.FlexProjectMetadata.Should().NotBeNull(); project.FlexProjectMetadata.WritingSystems.Should().BeEquivalentTo(_writingSystems); } diff --git a/backend/Testing/Services/CleanupResetProjectsTests.cs b/backend/Testing/Services/CleanupResetProjectsTests.cs index f4ca6091a..431d2b1de 100644 --- a/backend/Testing/Services/CleanupResetProjectsTests.cs +++ b/backend/Testing/Services/CleanupResetProjectsTests.cs @@ -22,8 +22,8 @@ public void CanGetDateFromResetRepoName() var expected = DateTimeOffset.Now; var repoName = HgService.DeletedRepoName("test", HgService.ResetSoftDeleteSuffix(expected)); var actual = HgService.GetResetDate(repoName); - actual.ShouldNotBeNull(); - TruncateToMinutes(actual.Value).Should().Be(TruncateToMinutes(expected)); + actual.Should().NotBeNull(); + TruncateToMinutes(actual!.Value).Should().Be(TruncateToMinutes(expected)); } private DateTimeOffset TruncateToMinutes(DateTimeOffset date) diff --git a/backend/Testing/Services/JwtHelper.cs b/backend/Testing/Services/JwtHelper.cs index 461a5e89c..5f839c832 100644 --- a/backend/Testing/Services/JwtHelper.cs +++ b/backend/Testing/Services/JwtHelper.cs @@ -58,7 +58,7 @@ public static async Task ExecuteLogin(SendReceiveAuth auth, public static string GetJwtFromLoginResponse(HttpResponseMessage response) { TryGetJwtFromLoginResponse(response, out var jwt); - jwt.ShouldNotBeNullOrEmpty(); + jwt.Should().NotBeNullOrEmpty(); return jwt; } diff --git a/backend/Testing/SyncReverseProxy/LegacyProjectApiTests.cs b/backend/Testing/SyncReverseProxy/LegacyProjectApiTests.cs index 95b54cbaa..ab48a04d8 100644 --- a/backend/Testing/SyncReverseProxy/LegacyProjectApiTests.cs +++ b/backend/Testing/SyncReverseProxy/LegacyProjectApiTests.cs @@ -32,11 +32,11 @@ private async Task ValidateResponse(HttpResponseMessage response) var content = await response.Content.ReadFromJsonAsync(); content.ValueKind.Should().Be(JsonValueKind.Array); var projectArray = JsonArray.Create(content); - projectArray.ShouldNotBeNull(); + projectArray.Should().NotBeNull(); projectArray.Count.Should().BeGreaterThan(0); var project = projectArray.First(p => p?["identifier"]?.GetValue() == TestingEnvironmentVariables.ProjectCode) as JsonObject; - project.ShouldNotBeNull(); + project.Should().NotBeNull(); var projectDict = new Dictionary(project); using (new AssertionScope()) { @@ -101,7 +101,7 @@ public async Task TestInvalidPassword() var content = await response.Content.ReadFromJsonAsync(); content.ValueKind.Should().Be(JsonValueKind.Object); var responseObject = JsonObject.Create(content); - responseObject.ShouldNotBeNull(); + responseObject.Should().NotBeNull(); responseObject.Should().ContainKey("error"); responseObject["error"]!.GetValue().Should().Be("Bad password"); } @@ -117,7 +117,7 @@ public async Task TestInvalidUser() var content = await response.Content.ReadFromJsonAsync(); content.ValueKind.Should().Be(JsonValueKind.Object); var responseObject = JsonObject.Create(content); - responseObject.ShouldNotBeNull(); + responseObject.Should().NotBeNull(); responseObject.Should().ContainKey("error"); responseObject["error"]!.GetValue().Should().Be("Unknown user"); } diff --git a/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs b/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs index 218e62fbf..8d6edc151 100644 --- a/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs +++ b/backend/Testing/SyncReverseProxy/SendReceiveServiceTests.cs @@ -105,7 +105,7 @@ public async Task ModifyProjectData(HgProtocol protocol) // Verify pushed and store last commit var lastCommitDate = await _adminApiTester.GetProjectLastCommit(projectConfig.Code); - lastCommitDate.ShouldNotBeNull(); + lastCommitDate.Should().NotBeNull(); // Modify var fwDataFileInfo = new FileInfo(sendReceiveParams.FwDataFile); @@ -137,7 +137,7 @@ public async Task SendReceiveAfterProjectReset(HgProtocol protocol) var response = await _adminApiTester.HttpClient.GetAsync(tipUri); var jsonResult = await response.Content.ReadFromJsonAsync(); var originalTip = jsonResult?["node"]?.AsValue()?.ToString(); - originalTip.ShouldNotBeNull(); + originalTip.Should().NotBeNull(); // /api/project/resetProject/{code} // /api/project/finishResetProject/{code} // leave project empty @@ -152,7 +152,7 @@ public async Task SendReceiveAfterProjectReset(HgProtocol protocol) response = await _adminApiTester.HttpClient.GetAsync(tipUri); jsonResult = await response.Content.ReadFromJsonAsync(); var emptyTip = jsonResult?["node"]?.AsValue()?.ToString(); - emptyTip.ShouldNotBeNullOrEmpty(); + emptyTip.Should().NotBeNullOrEmpty(); emptyTip.Replace("0", "").Should().BeEmpty(); // Step 3: do Send/Receive @@ -174,7 +174,7 @@ public async Task SendReceiveAfterProjectReset(HgProtocol protocol) response = await _adminApiTester.HttpClient.GetAsync(tipUri); jsonResult = await response.Content.ReadFromJsonAsync(); var postSRTip = jsonResult?["node"]?.AsValue()?.ToString(); - postSRTip.ShouldNotBeNull(); + postSRTip.Should().NotBeNull(); postSRTip.Should().Be(originalTip); } diff --git a/backend/Testing/Testing.csproj b/backend/Testing/Testing.csproj index fe87c212b..3ccb8771e 100644 --- a/backend/Testing/Testing.csproj +++ b/backend/Testing/Testing.csproj @@ -36,7 +36,7 @@ - +