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); }
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_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_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); }