UpdateCommentAsync

Have written the code to update comment and am getting the following exception. I have tried to work out what the issue is, but not obvious to me. Any help would be greatly appreciated.

A total of 1 test files matched the specified pattern.
X TestUpdatesComment [1s 768ms]
Error Message:
Object reference not set to an instance of an object.
Stack Trace:
at M220NTests.CommentControllerTests.TestUpdatesComment() in D:\MyDrive\Learning\M220 Csharp Project\mflix-cs\M220NTests\CommentControllerTests.cs:line 119
at M220NTests.CommentControllerTests.TestUpdatesComment() in D:\MyDrive\Learning\M220 Csharp Project\mflix-cs\M220NTests\CommentControllerTests.cs:line 124
at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter1.BlockUntilCompleted() at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaitable) at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func1 invoke)
at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.b__0()
at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)

Many thanks

Sending you a message to share the code.

Kanika

The error states that the type (object) of variable you are assigning to is not valid. For example, if you are trying to assign comment object to document type variable, it will throw an error.
You need to look at the variable assignment.

Kanika

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.