-
Notifications
You must be signed in to change notification settings - Fork 0
/
RejestracjaTesty.cpp
45 lines (37 loc) · 1.19 KB
/
RejestracjaTesty.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "pch.h"
#include "CppUnitTest.h"
#include "../rejestracja/main.cpp"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace RejestracjaTesty
{
TEST_CLASS(RejestracjaTesty)
{
public:
TEST_METHOD(TestValidateID)
{
Assert::IsTrue(validateID("12345678901"));
Assert::IsFalse(validateID("123"));
Assert::IsFalse(validateID("abcdefghijk"));
}
TEST_METHOD(TestValidatePassword)
{
Assert::IsTrue(validatePassword("securePwd1"));
Assert::IsFalse(validatePassword("short"));
}
TEST_METHOD(TestValidateUsername)
{
Assert::IsTrue(validateUsername("user1234"));
Assert::IsFalse(validateUsername("user"));
}
TEST_METHOD(TestValidateEmail)
{
Assert::IsTrue(validateEmail("[email protected]"));
Assert::IsFalse(validateEmail("invalid_email"));
}
TEST_METHOD(TestValidateLength)
{
Assert::IsTrue(validateLength("abcdef", 10));
Assert::IsFalse(validateLength("too_long_text", 5));
}
};
}