コード例 #1
0
        protected void SetupJsonSerializerDeserialize <T>(string response = null, T result = null)
            where T : class, new()
        {
            if (response == null)
            {
                response = It.IsAny <string>();
            }

            if (result == null)
            {
                result = new T();
            }

            MockJsonSerializer
            .Setup(x => x.Deserialize <T>(response))
            .Returns(result);
        }
コード例 #2
0
 protected void SetupJsonSerializerSerialize(string result = RequestJson)
 {
     MockJsonSerializer
     .Setup(x => x.Serialize(It.IsAny <object>()))
     .Returns(result);
 }