public void CanRemoveOperation() { // Arrange // Act ODataModelBuilder builder = new ODataModelBuilder(); ActionConfiguration action = builder.Action("Format"); OperationConfiguration operation = builder.Operations.SingleOrDefault(); bool removed = builder.RemoveOperation(operation); // Assert Assert.True(removed); Assert.Empty(builder.Operations); }
public void RemoveOperationByNameThrowsWhenAmbiguous() { // Arrange // Act ODataModelBuilder builder = new ODataModelBuilder(); ActionConfiguration action1 = builder.Action("Format"); ActionConfiguration action2 = builder.Action("Format"); action2.Parameter <int>("SegmentSize"); ExceptionAssert.Throws <InvalidOperationException>(() => { builder.RemoveOperation("Format"); }); }