예제 #1
0
        private void TestCorrectSerialization <T>(string json)
        {
            json = json.StripWhitespace();

            var deserialized = serializer.Deserialize <T>(json);
            var serialized   = serializer.Serialize(deserialized).StripWhitespace();

            Assert.AreEqual(json, serialized);
        }
        private void TestSuccessfulAction <T>(Func <T> action, T expectedResult)
            where T : class
        {
            var serializedExpectedResult = serializer.Serialize(expectedResult);
            var responseContent          = string.Format(SuccessfulResponseTemplate, serializedExpectedResult);

            mocker.SetupSuccessfulExecution <ApiResponse <T> >(responseContent);

            var result = action();

            AssertExtension.AreObjectsValuesEqual(expectedResult, result);
        }