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

Part 10 Programming exercise: Show and ticket. Error in class diagram? #144

Open
ZdravekSprite opened this issue May 4, 2020 · 1 comment

Comments

@ZdravekSprite
Copy link

class diagram is:
[Show]<-*[Ticket]
[Show|- movie: String;- time: String]
[Ticket|- seat: int;- code: int]
there should be:
[Show]<show-[Ticket]
[Show|- movie: String;- time: String]
[Ticket|- seat: int;- code: int]

@muzimuzhi
Copy link

Agree with you. Perhaps "[Show]<-[Ticket]" is enough because only the existence of reference is checked in corresponding test class ShowAndTicketTest.java.

Also in the test class, I think the second usages of method limitAttributeCount should be called with ("Ticket", 3), rather than ("Show", 3).

    @Test
    public void ClassesExist() {
        PrivateAttributesExist("Show", "movie", String.class);
        PrivateAttributesExist("Show", "time", String.class);
        limitAttributeCount("Show", 2);

        PrivateAttributesExist("Ticket", "seat", int.class);
        PrivateAttributesExist("Ticket", "code", int.class);
        limitAttributeCount("Show", 3);  // the first argument should be "Ticket"

        referenceExists("Ticket", "Show");
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants