Skip to content

Commit 06c6d98

Browse files
committed
switch to FluentAssertions
1 parent 27a2a0f commit 06c6d98

File tree

4 files changed

+168
-121
lines changed

4 files changed

+168
-121
lines changed

tests/DocumentationTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,41 @@ namespace Microscope.Tests {
44
using System.Collections.Generic;
55
using System.Linq;
66

7+
using FluentAssertions;
8+
79
using Microscope.CodeAnalysis;
810

911
using Microsoft.VisualStudio.TestTools.UnitTesting;
1012

1113
using Mono.Cecil.Cil;
1214

13-
using Shouldly;
14-
1515
[TestClass]
1616
public class DocumentationTests {
1717
// `System.Reflection.Emit.OpCodes` doesn't know of `ldelem.any`.
1818
[TestMethod] public void ReturnsNullForUnknownOpCode() =>
1919
OpCodes.Ldelem_Any
2020
.GetDocumentation()
21-
.ShouldBeNull();
21+
.Should().BeNull();
2222

2323
[TestMethod] public void KnowsAllOpCodes() =>
2424
AllKnownInstructions
2525
.Where(i => i.GetRawDocumentation() == null)
26-
.ShouldBeEmpty();
26+
.Should().BeEmpty();
2727

2828
[TestMethod] public void RemovesParamrefTags() =>
2929
OpCodes.Brtrue
3030
.GetDocumentation()
31-
.ShouldBe("Transfers control to a target instruction if `value` is true, not null, or non-zero.");
31+
.Should().Be("Transfers control to a target instruction if `value` is true, not null, or non-zero.");
3232

3333
[TestMethod] public void RemovesSeeCrefTags() =>
3434
OpCodes.Ckfinite
3535
.GetDocumentation()
36-
.ShouldBe("Throws `System.ArithmeticException` if value is not a finite number.");
36+
.Should().Be("Throws `System.ArithmeticException` if value is not a finite number.");
3737

3838
[TestMethod] public void ReturnsDocumentationForInstructionWithTrailingDot() =>
3939
OpCodes.Constrained
4040
.GetDocumentation()
41-
.ShouldBe("Constrains the type on which a virtual method call is made.");
41+
.Should().Be("Constrains the type on which a virtual method call is made.");
4242

4343
// The documentation was generated from all opcodes in `System.Reflection.Emit.OpCodes`, but the
4444
// actual instructions are retrieved as `Mono.Cecil.Cil.OpCodes`.

tests/GetDocumentExtTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ namespace Microscope.Tests {
55
using System.Collections.Immutable;
66
using System.Reflection;
77

8+
using FluentAssertions;
9+
810
using Microsoft.CodeAnalysis;
911
using Microsoft.VisualStudio.LanguageServices;
1012
using Microsoft.VisualStudio.TestTools.UnitTesting;
1113

12-
using Shouldly;
13-
1414
[TestClass]
1515
public class GetDocumentExtTests {
1616
[TestMethod]
1717
public void VisualStudioWorkspaceImplTypeExists() => typeof(VisualStudioWorkspace).Assembly
1818
.GetType(
1919
"Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl")
20-
.ShouldNotBeNull();
20+
.Should().NotBeNull();
2121

2222
[TestMethod]
2323
public void ProjectToGuidMapFieldExists() => typeof(VisualStudioWorkspace).Assembly
2424
.GetType(
2525
"Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl",
2626
throwOnError: true)
2727
.GetField("_projectToGuidMap", BindingFlags.NonPublic | BindingFlags.Instance)
28-
.ShouldNotBeNull();
28+
.Should().NotBeNull();
2929

3030
[TestMethod]
3131
public void ProjectToGuidMapFieldIsImmutableDictionary() => typeof(VisualStudioWorkspace).Assembly
@@ -34,7 +34,7 @@ public void ProjectToGuidMapFieldIsImmutableDictionary() => typeof(VisualStudioW
3434
throwOnError: true)
3535
.GetField("_projectToGuidMap", BindingFlags.NonPublic | BindingFlags.Instance)
3636
.FieldType
37-
.ShouldBe(typeof(ImmutableDictionary<ProjectId, Guid>));
37+
.Should().Be(typeof(ImmutableDictionary<ProjectId, Guid>));
3838

3939
[TestMethod]
4040
public void GetDocumentIdInCurrentContextMethodExists() => typeof(Workspace)
@@ -44,6 +44,6 @@ public void GetDocumentIdInCurrentContextMethodExists() => typeof(Workspace)
4444
binder: null,
4545
types: new[] { typeof(DocumentId) },
4646
modifiers: null)
47-
.ShouldNotBeNull();
47+
.Should().NotBeNull();
4848
}
4949
}

0 commit comments

Comments
 (0)