diff --git a/test/Dapr.Actors.Test/Description/MethodDescriptionTests.cs b/test/Dapr.Actors.Test/Description/MethodDescriptionTests.cs index 765a6ce3..c8162f5f 100644 --- a/test/Dapr.Actors.Test/Description/MethodDescriptionTests.cs +++ b/test/Dapr.Actors.Test/Description/MethodDescriptionTests.cs @@ -12,6 +12,7 @@ // ------------------------------------------------------------------------ using System; +using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; @@ -36,7 +37,7 @@ public void MethodDescription_CreatMethodDescription() description.MethodInfo.ShouldBeSameAs(methodInfo); description.Name.ShouldBe("GetString"); - description.ReturnType.ShouldBeOfType>(); + description.ReturnType.ShouldBe(typeof(Task)); description.Id.ShouldNotBe(0); description.Arguments.ShouldBeEmpty(); description.HasCancellationToken.ShouldBeFalse(); @@ -66,11 +67,8 @@ public void MethodDescription_CreateGeneratesArgumentDescriptions_WhenMethodHasA // Assert description.Arguments.ShouldNotBeNull(); - description.Arguments.ShouldBeOfType(); - description.Arguments.ShouldBeEquivalentTo(new[] - { - new { Name = "number" }, new { Name = "choice" }, new { Name = "information" } - }); + description.Arguments.ShouldBeOfType(); + description.Arguments.Select(m => new {m.Name}).ShouldBe(new[] {new {Name = "number"}, new {Name = "choice"}, new {Name = "information"}}); } [Fact] @@ -98,7 +96,7 @@ public void MethodDescription_CreateThrowsArgumentException_WhenMethodHasTokenAs // Assert var exception = Should.Throw(action); - exception.Message.ShouldBe("Method 'MethodWithTokenNotLast' of actor interface '*+ITestActor' has a '*.CancellationToken' parameter that is not the last parameter. If an actor method accepts a '*.CancellationToken' parameter, it must be the last parameter.*"); + exception.Message.ShouldMatch(@"Method 'MethodWithTokenNotLast' of actor interface '.*\+ITestActor' has a '.*\.CancellationToken' parameter that is not the last parameter. If an actor method accepts a '.*\.CancellationToken' parameter, it must be the last parameter\..*"); exception.ParamName.ShouldBe("actorInterfaceType"); }