Teammates: AccountAttributes: Add test cases for builder

Created on 21 Feb 2018  路  9Comments  路  Source: TEAMMATES/teammates

We recently added a builder for AccountAttributes (#8382) but the added builder class isn't covered by tests (see StudentProfileAttributesTest for examples of possible unit tests). We should add tests to ensure that construction works.

a-Testing good first issue p.Low

Most helpful comment

Here is a list of few tests done for builder pattern which can be used for reference.

Although the tests will be very similar to the ones above. In AccountAttributes, the .build() sanitizes all data members, which is something that would need to be taken care of while doing assertion checks

https://github.com/TEAMMATES/teammates/blob/d55382c0bf2720ee77dc96f5cb7c079884afb915/src/main/java/teammates/common/datatransfer/attributes/AccountAttributes.java#L110-L120

All 9 comments

If you aren't working on this already, I can take it up since I had worked on #8382 to add a builder pattern for AccountAttributes

If you aren't working on this already, I can take it up since I had worked on #8382 to add a builder pattern for AccountAttributes

Is this suitable for new contributors? If so, you can review the PR when it comes in.

Is this suitable for new contributors?

Should be suitable considering they can have a look at tests of other builder patterns used, for e.g. CourseAttributes , StudentProfileAttributes and get a good idea of what to do.

If so, you can review the PR when it comes in.

Sounds good to me :)

@tshradheya can list here the classes that have similar tests for the new contributor to follow?

Here is a list of few tests done for builder pattern which can be used for reference.

Although the tests will be very similar to the ones above. In AccountAttributes, the .build() sanitizes all data members, which is something that would need to be taken care of while doing assertion checks

https://github.com/TEAMMATES/teammates/blob/d55382c0bf2720ee77dc96f5cb7c079884afb915/src/main/java/teammates/common/datatransfer/attributes/AccountAttributes.java#L110-L120

I am a first timer.Can I work on this?

@lightt77 Yes. Feel free to take this up

@tshradheya Can you please review my PR?(#8551)

@lightt77 Will do.
Note: Avoid referencing issue number in commit messages as it spams the thread

Was this page helpful?
0 / 5 - 0 ratings