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

add samples for optionalExpectations of api-fluent #917

Closed
4 tasks
robstoll opened this issue May 22, 2021 · 20 comments · Fixed by #1031
Closed
4 tasks

add samples for optionalExpectations of api-fluent #917

robstoll opened this issue May 22, 2021 · 20 comments · Fixed by #1031
Assignees
Labels
Milestone

Comments

@robstoll
Copy link
Owner

robstoll commented May 22, 2021

Code related feature

With this issue we want to add samples for optionalExpectations.kt of api-fluent

Following the things you need to do:

api-fluent

  • create OptionalExpectationSamples in apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples
  • add one function per function in optionalExpectations.kt (see ListExpectationSamples)
    • for functions having two overloads where one expects an assertionCreator in addition -- add the suffix Feature to the function name of the one not expecting assertionCreator (see ListExpectationSamples)
  • refer to the sample in the KDoc of the corresponding function in optionalExpectations.kt via @sample (check out toEqual in anyExpectations.kt to see how you have to refer to the sample)

Your first contribution?

  • Write a comment I'll work on this if you would like to take this issue over.
    This way we get the chance to revise the description in case things have changed in the meantime, we might give you additional hints and we can assign the task to you, so that others do not start as well.
  • See Your first code contribution for guidelines.
  • Do not hesitate to ask questions here or to contact us via Atrium's slack channel if you need help
    (Invite yourself in case you do not have an account yet).
@ghost
Copy link

ghost commented May 25, 2021

I'll work on this.But i have no idea ,how this gonna happen.But i want to try this once

@robstoll robstoll assigned ghost May 25, 2021
@ghost
Copy link

ghost commented May 25, 2021

can u tell me how to start....i m new to github...and opensource too

@robstoll
Copy link
Owner Author

See above, the link your first contribution

@ghost
Copy link

ghost commented May 25, 2021

unable to find ListExpectationSamples

@robstoll
Copy link
Owner Author

robstoll commented May 25, 2021

Have you forked and cloned the project? You should find it easily via search function of your IDE

@ghost
Copy link

ghost commented May 25, 2021

yes i forked and cloned it.and also foundListExpectationSamples.Now what to do next..i mean what r the function to be made?

@robstoll
Copy link
Owner Author

robstoll commented May 25, 2021

See the description of this issue. it's more or less a one to one step description. Have you created the OptionalExpectationSamples? Once done you do the next step etc.

@ghost
Copy link

ghost commented May 25, 2021 via email

@robstoll
Copy link
Owner Author

In case you run into another problem, then create a draft PR please. This way I see what you have already done and thus better understand what next step you try to achieve.

@robstoll
Copy link
Owner Author

robstoll commented Jun 7, 2021

@ArcaneOP do you need help?

@ghost
Copy link

ghost commented Jun 7, 2021 via email

@robstoll
Copy link
Owner Author

robstoll commented Jun 7, 2021

No problem at all, no rush, just wanted to be sure you don't have obstacles on the way 🙂

@ghost
Copy link

ghost commented Jun 7, 2021 via email

@timacosta
Copy link
Contributor

I'll work on this, seems like the previous person's account got deleted. Assign it if OK.

@robstoll
Copy link
Owner Author

robstoll commented Oct 5, 2021

@timacosta do you need help with this?

@timacosta
Copy link
Contributor

@robstoll just didn't manage to take over on this yet. Will do this week if there is no rush! If any I'll let you know.

@robstoll
Copy link
Owner Author

robstoll commented Oct 5, 2021

No rush at all

@timacosta
Copy link
Contributor

timacosta commented Oct 10, 2021

@robstoll I've started slowly on this one (didn't have any time until now) and I was wondering how complex you expect these samples to be. I was just dealing a bit with the different functions in optionalSamples.kt and think I got the point. Just asking before going deeper, cause you can actually do it as complex as possible with Optionals.

Let me know and clarify if needed, what kind of use cases are you expecting and I can elaborate from there.

Here is what I did just messing around, simple.

@Test
    fun toBeEmpty() {
        val empty: String? = null
        val opt = Optional.ofNullable(empty)

        expect(opt).toBeEmpty()
    }

    @Test
    fun toBePresent() {
        val notEmpty: String? = "toBePresent"
        val opt = Optional.ofNullable(notEmpty)

        expect(opt).toBePresent()
    }

@robstoll
Copy link
Owner Author

Rather simple, take a look at other examples. It's always good to have a passing and a failing sample.

@timacosta
Copy link
Contributor

@robstoll PR - #1031

Comment in the PR if anything is missing or need any re-do. Examples are rather simple but I hope it does the job. Thx

@robstoll robstoll added this to the 0.18.0 milestone Nov 1, 2021
@robstoll robstoll linked a pull request Nov 7, 2021 that will close this issue
@robstoll robstoll closed this as completed Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants