Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Case: Updating Given-When-Then #30

Closed
lvanvugt opened this issue Jun 22, 2020 · 10 comments
Closed

Use Case: Updating Given-When-Then #30

lvanvugt opened this issue Jun 22, 2020 · 10 comments
Assignees
Labels
version A To be picked up right away
Milestone

Comments

@lvanvugt
Copy link
Contributor

lvanvugt commented Jun 22, 2020

The following flowchart shows the use case:

Use Case (#30) - Updating Given-When-Then

Exceptions

  • Non-alpabathic or non-numerical characters should not be ported to helper function names (see also Use Case: Adding Given-When-Then #27)
  • Given/When/Then description should not have unlimited length as AL function names have a max length of 120 characters
    • I suggest to build logic that checks allowed length in Given/When/Then description based on text with "to be removed" non-alpabathic or non-numerical characters (see also Use Case: Adding Given-When-Then #27)
  • A helper-Function will only be renamed if it matched the old value of the given-when-then-statement.

Settings

THEN clause: Warehouse shipment line is deleted
function name:  VerifyWarehouseShipmentLineIsDeleted();

Notes

@lvanvugt lvanvugt added enhancement New feature or request version B Next to be picked up (but needs probably some detailing) labels Jun 22, 2020
@lvanvugt lvanvugt assigned lvanvugt and DavidFeldhoff and unassigned lvanvugt Jun 29, 2020
lvanvugt pushed a commit that referenced this issue Jun 29, 2020
@DavidFeldhoff
Copy link
Collaborator

Adding to the exceptions:
A helper-Function will only be renamed if it matched the old value of the given-when-then-statement.

@lvanvugt
Copy link
Contributor Author

Adding to the exceptions:
A helper-Function will only be renamed if it matched the old value of the given-when-then-statement.

Added to main description.

@DavidFeldhoff
Copy link
Collaborator

DavidFeldhoff commented Jul 27, 2020

@lvanvugt with the latest changes on the "AddingGivenWhenThen"-branch the rename-part is ready to test. Please give me feedback, if something's missing.
I don't know yet what to do in the following cases:

// [GIVEN] Manually created warehouse shipment from released sales order with one line with require shipment location
        WarehouseShipmentNo := CreateManuallyCreatedWarehouseShipmentFromReleasedSalesOrderWithOneLineWithRequireShipmentLocation(LocationCode);

Currently I update the procedure call to a renamed one and let the return value and the passing of the parameter untouched. But the newly created procedure with the updated name does not have a parameter or a return value, so that there's a compiler error. But maybe if don't assign the variable on return anymore I'll have a similar - maybe even worse - problem as probably everything is compilable, but the tests will fail as the variable which was assigned on return previously isn't assigned anymore yet which could be tricky to find out.
It would be possible to add the return variable and the parameter by using the AL CodeActions extension, but then we'd have a dependency.. I'll leave that decision up to you.

lvanvugt pushed a commit that referenced this issue Aug 18, 2020
lvanvugt pushed a commit that referenced this issue Aug 18, 2020
@DavidFeldhoff DavidFeldhoff added version A To be picked up right away and removed version B Next to be picked up (but needs probably some detailing) labels Sep 7, 2020
lvanvugt pushed a commit that referenced this issue Sep 24, 2020
@DavidFeldhoff
Copy link
Collaborator

@lvanvugt I found a case which is not defined yet:
We're in the upper right corner in the flow chart. Given helper functino is called multiple times? No -> New helper function already exists? -> What to do? I can't rename the old one as there are two functions wit the same naming and parameters then. Should I switch to the new one then and ask the user if the old one should be deleted?

@lvanvugt
Copy link
Contributor Author

@DavidFeldhoff great catch. I would say, leave the old one. Would that make sense?

@DavidFeldhoff
Copy link
Collaborator

So we would change the procedure call to use the existing one and leave the old procedure as it is (which won't have any references then)?

Or should we just throw an error in this rare case that the user should solve it on his own as it could be that there's no right or wrong

@lvanvugt
Copy link
Contributor Author

OK, misunderstood it first. Your latter suggestion makes sense. Let's do that.

Or should we just throw an error in this rare case that the user should solve it on his own as it could be that there's no right or wrong

@lvanvugt
Copy link
Contributor Author

lvanvugt commented Oct 27, 2020

Retest, but two news bugs appear (see above).

Update 20201029
One to go: #68

@lvanvugt lvanvugt removed the enhancement New feature or request label Oct 28, 2020
@lvanvugt
Copy link
Contributor Author

Retest, but new bug appears (see above).

Update 20201121
One to go: #79

@lvanvugt lvanvugt changed the title Use Case: Update Given-When-Then Use Case: Updating Given-When-Then Nov 22, 2020
@lvanvugt
Copy link
Contributor Author

As #79 was retested and found OK this Use Case is ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version A To be picked up right away
Projects
None yet
Development

No branches or pull requests

2 participants