Ejemplo n.º 1
0
        public void GetElementTypeInvalidArgumentTest()
        {
            // Arrange
            var mm = new ModelManager(new PluralizationService());

            // Act
            Type x = mm.GetElementType(typeof(Author));

            // Assert
            Assert.IsNull(x, "Return value of GetElementType should be null for a non-Many type argument!");
        }
Ejemplo n.º 2
0
        public void GetElementTypeTest()
        {
            // Arrange
            var mm = new ModelManager(new PluralizationService());

            // Act
            Type postTypeFromArray = mm.GetElementType(typeof(Post[]));
            Type postTypeFromEnumerable = mm.GetElementType(typeof(IEnumerable<Post>));

            // Assert
            Assert.AreSame(typeof(Post), postTypeFromArray);
            Assert.AreSame(typeof(Post), postTypeFromEnumerable);
        }