Esempio n. 1
0
        public void GetEdmType_ThrowArgumentException_IfArgumentNotNull()
        {
            // Arrange
            var             segment = new UnboundActionPathSegment("CreateCustomer");
            Mock <IEdmType> edmType = new Mock <IEdmType>();

            // Act & Assert
            Assert.Throws <ArgumentException>(() => segment.GetEdmType(edmType.Object));
        }
        public void GetEdmType_ReturnsNull_IfActionNull()
        {
            // Arrange
            var segment = new UnboundActionPathSegment("TopCustomer");

            // Act
            var result = segment.GetEdmType(previousEdmType: null);

            // Assert
            Assert.Null(result);
        }
Esempio n. 3
0
        public void GetEdmType_ReturnsNull_UnboundAction()
        {
            // Arrange
            IEdmActionImport action = _container.FindOperationImports("ActionWithoutReturn").SingleOrDefault() as IEdmActionImport;

            // Act
            UnboundActionPathSegment segment = new UnboundActionPathSegment(action);
            var result = segment.GetEdmType(previousEdmType: null);

            // Assert
            Assert.Null(result);
        }
Esempio n. 4
0
        public void GetEdmType_ReturnsNotNull_UnboundActionEntityType()
        {
            // Arrange
            IEdmActionImport action = _container.FindOperationImports("CreateCustomer").SingleOrDefault() as IEdmActionImport;

            // Act
            UnboundActionPathSegment segment = new UnboundActionPathSegment(action);
            var result = segment.GetEdmType(previousEdmType: null);

            // Assert
            Assert.NotNull(result);
            Assert.Equal("System.Web.OData.Routing.MyCustomer", result.FullTypeName());
        }
Esempio n. 5
0
        public void GetEdmType_ReturnsNotNull_UnboundActionPrimitiveType()
        {
            // Arrange
            IEdmActionImport action = _container.FindOperationImports("MyAction").SingleOrDefault() as IEdmActionImport;

            // Act
            UnboundActionPathSegment segment = new UnboundActionPathSegment(action);
            var result = segment.GetEdmType(previousEdmType: null);

            // Assert
            Assert.NotNull(result);
            Assert.Equal("Edm.String", result.FullTypeName());
        }
        public void GetEdmType_ReturnsNotNull_UnboundActionEntityType()
        {
            // Arrange
            IEdmActionImport action = _container.FindOperationImports("CreateCustomer").SingleOrDefault() as IEdmActionImport;

            // Act
            UnboundActionPathSegment segment = new UnboundActionPathSegment(action);
            var result = segment.GetEdmType(previousEdmType: null);

            // Assert
            Assert.NotNull(result);
            Assert.Equal("System.Web.OData.Routing.MyCustomer", result.FullTypeName());
        }
        public void GetEdmType_ThrowArgumentException_IfArgumentNotNull()
        {
            // Arrange
            var segment = new UnboundActionPathSegment("CreateCustomer");
            Mock<IEdmType> edmType = new Mock<IEdmType>();

            // Act & Assert
            Assert.Throws<ArgumentException>(() => segment.GetEdmType(edmType.Object));
        }
        public void GetEdmType_ReturnsNull_UnboundAction()
        {
            // Arrange
            IEdmActionImport action = _container.FindOperationImports("ActionWithoutReturn").SingleOrDefault() as IEdmActionImport;

            // Act
            UnboundActionPathSegment segment = new UnboundActionPathSegment(action);
            var result = segment.GetEdmType(previousEdmType: null);

            // Assert
            Assert.Null(result);
        }
        public void GetEdmType_ReturnsNotNull_UnboundActionPrimitiveType()
        {
            // Arrange
            IEdmActionImport action = _container.FindOperationImports("MyAction").SingleOrDefault() as IEdmActionImport;

            // Act
            UnboundActionPathSegment segment = new UnboundActionPathSegment(action);
            var result = segment.GetEdmType(previousEdmType: null);

            // Assert
            Assert.NotNull(result);
            Assert.Equal("Edm.String", result.FullTypeName());
        }
        public void GetEdmType_ReturnsNull_IfActionNull()
        {
            // Arrange
            var segment = new UnboundActionPathSegment("TopCustomer");

            // Act
            var result = segment.GetEdmType(previousEdmType: null);

            // Assert
            Assert.Null(result);
        }