Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
7b3d997
commit 75f3919
Showing
10 changed files
with
266 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/test/java/org/assertj/core/api/charsequence/CharSequenceAssert_isLowerCase_Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* Copyright 2012-2018 the original author or authors. | ||
*/ | ||
package org.assertj.core.api.charsequence; | ||
|
||
import static org.mockito.Mockito.verify; | ||
|
||
import org.assertj.core.api.CharSequenceAssert; | ||
import org.assertj.core.api.CharSequenceAssertBaseTest; | ||
|
||
public class CharSequenceAssert_isLowerCase_Test extends CharSequenceAssertBaseTest { | ||
|
||
@Override | ||
protected CharSequenceAssert invoke_api_method() { | ||
return assertions.isLowerCase(); | ||
} | ||
|
||
@Override | ||
protected void verify_internal_effects() { | ||
verify(strings).assertLowerCase(getInfo(assertions), getActual(assertions)); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/test/java/org/assertj/core/api/charsequence/CharSequenceAssert_isUpperCase_Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* Copyright 2012-2018 the original author or authors. | ||
*/ | ||
package org.assertj.core.api.charsequence; | ||
|
||
import static org.mockito.Mockito.verify; | ||
|
||
import org.assertj.core.api.CharSequenceAssert; | ||
import org.assertj.core.api.CharSequenceAssertBaseTest; | ||
|
||
public class CharSequenceAssert_isUpperCase_Test extends CharSequenceAssertBaseTest { | ||
|
||
@Override | ||
protected CharSequenceAssert invoke_api_method() { | ||
return assertions.isUpperCase(); | ||
} | ||
|
||
@Override | ||
protected void verify_internal_effects() { | ||
verify(strings).assertUpperCase(getInfo(assertions), getActual(assertions)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/test/java/org/assertj/core/internal/strings/Strings_assertIsLowerCase_Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* Copyright 2012-2018 the original author or authors. | ||
*/ | ||
package org.assertj.core.internal.strings; | ||
|
||
import static org.assertj.core.error.ShouldBeLowerCase.shouldBeLowerCase; | ||
import static org.assertj.core.test.TestData.someInfo; | ||
import static org.assertj.core.util.FailureMessages.actualIsNull; | ||
|
||
import org.assertj.core.internal.StringsBaseTest; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Tests for <code>{@link org.assertj.core.internal.Strings#assertLowerCase(org.assertj.core.api.AssertionInfo, CharSequence)} </code>. | ||
* | ||
* @author Marcel Overdijk | ||
*/ | ||
public class Strings_assertIsLowerCase_Test extends StringsBaseTest { | ||
|
||
@Test | ||
public void should_pass_if_actual_is_lowercase() { | ||
strings.assertLowerCase(someInfo(), "lego"); | ||
} | ||
|
||
@Test | ||
public void should_pass_if_actual_is_empty() { | ||
strings.assertLowerCase(someInfo(), ""); | ||
} | ||
|
||
@Test | ||
public void should_fail_if_actual_is_not_fully_lowercase() { | ||
thrown.expectAssertionError(shouldBeLowerCase("Lego")); | ||
strings.assertLowerCase(someInfo(), "Lego"); | ||
} | ||
|
||
@Test | ||
public void should_fail_if_actual_is_uppercase() { | ||
thrown.expectAssertionError(shouldBeLowerCase("LEGO")); | ||
strings.assertLowerCase(someInfo(), "LEGO"); | ||
} | ||
|
||
@Test | ||
public void should_fail_if_actual_is_null() { | ||
thrown.expectAssertionError(actualIsNull()); | ||
strings.assertLowerCase(someInfo(), null); | ||
} | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
src/test/java/org/assertj/core/internal/strings/Strings_assertIsUpperCase_Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* Copyright 2012-2018 the original author or authors. | ||
*/ | ||
package org.assertj.core.internal.strings; | ||
|
||
import static org.assertj.core.error.ShouldBeUpperCase.shouldBeUpperCase; | ||
import static org.assertj.core.test.TestData.someInfo; | ||
import static org.assertj.core.util.FailureMessages.actualIsNull; | ||
|
||
import org.assertj.core.internal.StringsBaseTest; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Tests for <code>{@link org.assertj.core.internal.Strings#assertUpperCase(org.assertj.core.api.AssertionInfo, CharSequence)} </code>. | ||
* | ||
* @author Marcel Overdijk | ||
*/ | ||
public class Strings_assertIsUpperCase_Test extends StringsBaseTest { | ||
|
||
@Test | ||
public void should_pass_if_actual_is_uppercase() { | ||
strings.assertUpperCase(someInfo(), "LEGO"); | ||
} | ||
|
||
@Test | ||
public void should_pass_if_actual_is_empty() { | ||
strings.assertUpperCase(someInfo(), ""); | ||
} | ||
|
||
@Test | ||
public void should_fail_if_actual_is_not_only_uppercase() { | ||
thrown.expectAssertionError(shouldBeUpperCase("Lego")); | ||
strings.assertUpperCase(someInfo(), "Lego"); | ||
} | ||
|
||
@Test | ||
public void should_fail_if_actual_is_lowercase() { | ||
thrown.expectAssertionError(shouldBeUpperCase("lego")); | ||
strings.assertUpperCase(someInfo(), "lego"); | ||
} | ||
|
||
@Test | ||
public void should_fail_if_actual_is_null() { | ||
thrown.expectAssertionError(actualIsNull()); | ||
strings.assertUpperCase(someInfo(), null); | ||
} | ||
|
||
} |