Hi I have created a wrapper over the JavascriptSerializer to be able to moq this.

This is my code:

```
public class JavascriptSerializerWrapper : IJavascriptSerializerWrapper
{
    public JavaScriptSerializer GetJavascriptSerializer()
    {
        return new JavaScriptSerializer();
    }
}

```

Now in my unit tests I have tryed to mock this like this:

```
    private Mock<IJavascriptSerializerWrapper> m_JavascriptSerializerWrapper;

    [TestInitialize]
    public void Initializer()
    {
        m_JavascriptSerializerWrapper = new Mock<IJavascriptSerializerWrapper>();
    }

    [TestMethod]
    public void Login_IsValidUser_ReturnsTrue()
    {
        const string serializedObject = "{\"EmailAddress\":\"kimmiem30@hotmail.com123\",\"StudentId\":1200528,\"TeacherId\":null,\"EmployeeId\":null,\"PersonId\":82249,\"MessageUserId\":410335}";
         m_JavascriptSerializerWrapper.Setup(x => x.GetJavascriptSerializer().Serialize(userInfoDTO)).Returns(serializedObject);
    }

```

I have debugged the unit test and I got this error:

> 
> Invalid setup on a non-virtual (overridable in VB) member: x => x.GetJavascriptSerializer().Serialize(.userInfoDTO)
> 
> 
> 

What am I doing wrong here and how can I solve this problem?