Last active
May 9, 2020 07:13
-
-
Save turkergoksu/f772f1aee72d68166678911d86b8f34d to your computer and use it in GitHub Desktop.
YTT_Odev_Test_Cases
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
package me.turkergoksu.yazilimsinama | |
import junit.framework.TestCase | |
import org.junit.Test | |
/** | |
* Created by turkergoksu on 09-May-20, 7:33 AM | |
*/ | |
class AccountUtilTest : TestCase() { | |
private val accountUtil = AccountUtil() | |
/* | |
Test 1: Tüm inputları boş olarak girmek | |
*/ | |
@Test | |
fun testChangePassword_EmptyInputs() { | |
assertEquals(false, accountUtil.changePassword("", "", "").isSuccess) | |
} | |
/* | |
Test 2: Tüm inputları dogru girmek | |
*/ | |
@Test | |
fun testChangePassword_CorrectInputs() { | |
assertEquals( | |
true, | |
accountUtil.changePassword("123456", "yeniparola", "yeniparola").isSuccess | |
) | |
} | |
/* | |
Test 3: Eski parolayı yanlış girmek | |
*/ | |
@Test | |
fun testChangePassword_WrongOldPassword() { | |
assertEquals( | |
false, | |
accountUtil.changePassword("abcdef", "yeniparola", "yeniparola").isSuccess | |
) | |
} | |
/* | |
Test 4: Yeni parolanın eski parola ile aynı olması | |
*/ | |
@Test | |
fun testChangePassword_NewPasswordEqualsToOldPassword() { | |
assertEquals(false, accountUtil.changePassword("123456", "123456", "123456").isSuccess) | |
} | |
/* | |
Test 5: Onaylama parolasını yanlış girmek | |
*/ | |
@Test | |
fun testChangePassword_WrongConfirmPassword() { | |
assertEquals( | |
false, | |
accountUtil.changePassword("123456", "yeniparola", "yeniparolaa").isSuccess | |
) | |
} | |
/* | |
Test 6: Yeni parolanın karakter uzunlugunun 6'dan kücük olması | |
*/ | |
@Test | |
fun testChangePassword_PasswordLengthShouldBeTaller() { | |
assertEquals(false, accountUtil.changePassword("123456", "yenip", "yenip").isSuccess) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment