# Unit Testing for C# Devs - Creating Moq Objects

**URL:** <https://forum.codewithmosh.com/t/unit-testing-for-c-devs-creating-moq-objects/27955>\
**Category:** C#\
**Created:** [July 29, 2024, 6:20pm UTC](https://forum.codewithmosh.com/t/unit-testing-for-c-devs-creating-moq-objects/27955 "2024-07-29T18:20:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimanjenje](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/dimanjenje/32/331_2.png) [@dimanjenje](https://forum.codewithmosh.com/u/dimanjenje)\
**Post date:** [July 29, 2024, 6:20pm UTC](https://forum.codewithmosh.com/t/unit-testing-for-c-devs-creating-moq-objects/27955/1 "2024-07-29T18:20:11Z")

</div>

Hello guys, in Unit Testing course on the lesson about Creating Mock Objects using Moq, Mosh give us an example of testing ReadVideoTitle\_EmptyFile\_ReturnError

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/d/de000c1d8468c50aa7bda4f0c7986fe2089201e4.jpeg)

My questions is: **How can I test the other scenario, where the video title is returned?**  
I tried to Mock the same way but Im get an error with msg “Newtonsoft.Json.JsonReaderException : Unexpected character encountered while parsing value: M. Path ‘’, line 0, position 0.” Like the compile is looking into real file

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/3/3b012b11c01659e8beb9c057fc043a978ad9d0c7.png)

Has anyone tested this scenario using Moq?
