コード例 #1
0
        public void CanReadType_JsonObjectContract_ReturnsTrue(MultipartJsonMediaTypeFormatter sut)
        {
            var types = new[]
            {
                typeof(TestModel)
            };

            foreach (var t in types)
            {
                Assert.True(sut.CanReadType(t), string.Format("CanReadType must support {0}", t.FullName));
            }
        }
コード例 #2
0
        public void CanReadType_JsonPrimitiveContract_ReturnsFalse(MultipartJsonMediaTypeFormatter sut)
        {
            var types = new[]
            {
                typeof(bool), typeof(string), typeof(int), typeof(long), typeof(int?), typeof(DateTime)
            };

            foreach (var t in types)
            {
                Assert.False(sut.CanReadType(t), string.Format("CanReadType must not support {0}", t.FullName));
            }
        }