/
Grovi1
/
AuthApp
Обзор
Документация
Войти
/
Grovi1
/
AuthApp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
AuthApp.Tests/AuthenticationServiceTests.cs
60 строк
2 KB
Grovi
Initial commit: AuthApp
07 апр 2026, 16:30
07 апр 2026, 16:30
fb91810
Код
Авторство
О чём код?
using AuthApp.Services; using Xunit; namespace AuthApp.Tests { public class AuthenticationServiceTests { private readonly AuthenticationService _authService; public AuthenticationServiceTests() { _authService = new AuthenticationService(); } [Fact] public void Login_ValidCredentials_ReturnsTrue() { // Arrange string username = "user1"; string password = "password123"; // Act bool result = _authService.Login(username, password); // Assert Assert.True(result); } [Fact] public void Login_InvalidCredentials_ReturnsFalse() { bool result = _authService.Login("wrong", "wrong"); Assert.False(result); } [Theory] [InlineData("", "pass")] [InlineData("user", "")] [InlineData(null, "pass")] public void Login_EmptyOrNullCredentials_ReturnsFalse(string username, string password) { bool result = _authService.Login(username, password); Assert.False(result); } [Fact] public void IsPasswordStrong_ValidStrongPassword_ReturnsTrue() { bool result = _authService.IsPasswordStrong("Strong123"); Assert.True(result); } [Fact] public void IsPasswordStrong_WeakPassword_ReturnsFalse() { bool result = _authService.IsPasswordStrong("weak"); Assert.False(result); } } }