Пример #1
0
        public void IsSerializedAsManyTest()
        {
            // Arrange
            var mm = new ModelManager(new PluralizationService());

            // Act
            bool isArray = mm.IsSerializedAsMany(typeof(Post[]));
            bool isGenericEnumerable = mm.IsSerializedAsMany(typeof(IEnumerable<Post>));
            bool isString = mm.IsSerializedAsMany(typeof(string));
            bool isAuthor = mm.IsSerializedAsMany(typeof(Author));
            bool isNonGenericEnumerable = mm.IsSerializedAsMany(typeof(IEnumerable));

            // Assert
            Assert.IsTrue(isArray);
            Assert.IsTrue(isGenericEnumerable);
            Assert.IsFalse(isString);
            Assert.IsFalse(isAuthor);
            Assert.IsFalse(isNonGenericEnumerable);
        }