Suppression des constructeurs pour user et notepad

pull/40/head
Clement CHIEU 1 year ago
parent 99471a3705
commit c4dd76334d

@ -7,32 +7,10 @@ public class NotepadEntity
{ {
public int Id { get; set; } public int Id { get; set; }
[ForeignKey(nameof(User))] [ForeignKey(nameof(User))] public int UserId { get; set; }
public int UserId { get; set; }
public UserEntity User { get; set; } public UserEntity User { get; set; }
[ForeignKey(nameof(Inquiry))] [ForeignKey(nameof(Inquiry))] public int InquiryId { get; set; }
public int InquiryId { get; set; }
public InquiryEntity Inquiry { get; set; } public InquiryEntity Inquiry { get; set; }
public string Notes { get; set; } public string Notes { get; set; }
public NotepadEntity() { }
public NotepadEntity(int id, int userId, UserEntity user, int inquiryId, InquiryEntity inquiry, string notes)
{
Id = id;
UserId = userId;
User = user;
InquiryId = inquiryId;
Inquiry = inquiry;
Notes = notes;
}
public NotepadEntity(int userId, UserEntity user, int inquiryId, InquiryEntity inquiry, string notes)
{
UserId = userId;
User = user;
InquiryId = inquiryId;
Inquiry = inquiry;
Notes = notes;
}
} }

@ -10,30 +10,4 @@ public class UserEntity
public string Password { get; set; } public string Password { get; set; }
public string Email { get; set; } public string Email { get; set; }
public bool IsAdmin { get; set; } public bool IsAdmin { get; set; }
public UserEntity()
{
}
public UserEntity(int id)
{
Id = id;
}
public UserEntity(int id, string username, string password, string email, bool isAdmin)
{
Id = id;
Username = username;
Password = password;
Email = email;
IsAdmin = isAdmin;
}
public UserEntity(string username, string password, string email, bool isAdmin)
{
Username = username;
Password = password;
Email = email;
IsAdmin = isAdmin;
}
} }

@ -6,7 +6,7 @@ namespace Shared.Mapper;
public static class NotepadMapper public static class NotepadMapper
{ {
public static Notepad FromDTOToModel(this NotepadDTO dto) public static Notepad FromDtoToModel(this NotepadDTO dto)
{ {
return new Notepad(dto.Id, dto.UserId, dto.InquiryId, dto.Notes); return new Notepad(dto.Id, dto.UserId, dto.InquiryId, dto.Notes);
} }
@ -16,33 +16,49 @@ public static class NotepadMapper
return new Notepad(ent.Id, ent.UserId, ent.InquiryId, ent.Notes); return new Notepad(ent.Id, ent.UserId, ent.InquiryId, ent.Notes);
} }
public static NotepadDTO FromModelToDTO(this Notepad not) public static NotepadDTO FromModelToDto(this Notepad not)
{ {
return new NotepadDTO(not.Id, not.UserId, not.InquiryId, not.Notes); return new NotepadDTO(not.Id, not.UserId, not.InquiryId, not.Notes);
} }
public static NotepadDTO FromEntityToDTO(this NotepadEntity ent) public static NotepadDTO FromEntityToDto(this NotepadEntity ent)
{ {
return new NotepadDTO(ent.Id, ent.UserId, ent.InquiryId, ent.Notes); return new NotepadDTO(ent.Id, ent.UserId, ent.InquiryId, ent.Notes);
} }
public static NotepadEntity FromDTOToEntity(this NotepadDTO dto) public static NotepadEntity FromDtoToEntity(this NotepadDTO dto)
{ {
return new NotepadEntity(dto.Id, new UserEntity(dto.UserId), dto.UserId, return new NotepadEntity
new InquiryEntity {
Id = dto.Id,
User = new UserEntity
{
Id = dto.UserId
},
UserId = dto.UserId,
Inquiry = new InquiryEntity
{ {
Id = dto.InquiryId Id = dto.InquiryId
}, },
dto.Notes); Notes = dto.Notes
};
} }
public static NotepadEntity FromModelToEntity(this Notepad not) public static NotepadEntity FromModelToEntity(this Notepad not)
{ {
return new NotepadEntity(not.Id, new UserEntity(not.UserId), not.UserId, return new NotepadEntity
new InquiryEntity {
Id = not.Id,
User = new UserEntity
{
Id = not.UserId
},
UserId = not.UserId,
Inquiry = new InquiryEntity
{ {
Id = not.InquiryId Id = not.InquiryId
}, },
not.Notes); Notes = not.Notes
};
} }
} }

@ -6,7 +6,7 @@ namespace Shared.Mapper;
public static class SuccessMapper public static class SuccessMapper
{ {
public static Success FromDTOToModel(this SuccessDTO dto) public static Success FromDtoToModel(this SuccessDTO dto)
{ {
return new Success(dto.UserId, dto.InquiryId, dto.IsFinished); return new Success(dto.UserId, dto.InquiryId, dto.IsFinished);
} }
@ -16,19 +16,23 @@ public static class SuccessMapper
return new Success(ent.UserId, ent.InquiryId, ent.IsFinished); return new Success(ent.UserId, ent.InquiryId, ent.IsFinished);
} }
public static SuccessDTO FromModelToDTO(this Success suc) public static SuccessDTO FromModelToDto(this Success suc)
{ {
return new SuccessDTO(suc.UserId, suc.InquiryId, suc.IsFinished); return new SuccessDTO(suc.UserId, suc.InquiryId, suc.IsFinished);
} }
public static SuccessDTO FromEntityToDTO(this SuccessEntity ent) public static SuccessDTO FromEntityToDto(this SuccessEntity ent)
{ {
return new SuccessDTO(ent.UserId, ent.InquiryId, ent.IsFinished); return new SuccessDTO(ent.UserId, ent.InquiryId, ent.IsFinished);
} }
public static SuccessEntity FromDTOToEntity(this SuccessDTO dto) public static SuccessEntity FromDtoToEntity(this SuccessDTO dto)
{ {
return new SuccessEntity(dto.UserId, new UserEntity(dto.UserId), dto.InquiryId, return new SuccessEntity(dto.UserId, new UserEntity
{
Id = dto.UserId
},
dto.InquiryId,
new InquiryEntity new InquiryEntity
{ {
Id = dto.InquiryId Id = dto.InquiryId
@ -38,7 +42,11 @@ public static class SuccessMapper
public static SuccessEntity FromModelToEntity(this Success suc) public static SuccessEntity FromModelToEntity(this Success suc)
{ {
return new SuccessEntity(suc.UserId, new UserEntity(suc.UserId), suc.InquiryId, return new SuccessEntity(suc.UserId, new UserEntity
{
Id = suc.UserId
},
suc.InquiryId,
new InquiryEntity new InquiryEntity
{ {
Id = suc.InquiryId Id = suc.InquiryId

@ -6,14 +6,21 @@ namespace Shared.Mapper;
public static class UserMapper public static class UserMapper
{ {
public static User FromDTOToModel(this UserDTO dto) public static User FromDtoToModel(this UserDTO dto)
{ {
return new User(dto.Id, dto.Username, dto.Password, dto.Email, dto.IsAdmin); return new User(dto.Id, dto.Username, dto.Password, dto.Email, dto.IsAdmin);
} }
public static UserEntity FromDTOToEntity(this UserDTO dto) public static UserEntity FromDtoToEntity(this UserDTO dto)
{ {
return new UserEntity(dto.Id, dto.Username, dto.Password, dto.Email, dto.IsAdmin); return new UserEntity
{
Id = dto.Id,
Username = dto.Username,
Password = dto.Password,
Email = dto.Email,
IsAdmin = dto.IsAdmin
};
} }
public static User FromEntityToModel(this UserEntity entity) public static User FromEntityToModel(this UserEntity entity)
@ -21,18 +28,25 @@ public static class UserMapper
return new User(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin); return new User(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin);
} }
public static UserDTO FromEntityToDTO(this UserEntity entity) public static UserDTO FromEntityToDto(this UserEntity entity)
{ {
return new UserDTO(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin); return new UserDTO(entity.Id, entity.Username, entity.Password, entity.Email, entity.IsAdmin);
} }
public static UserDTO FromModelToDTO(this User user) public static UserDTO FromModelToDto(this User user)
{ {
return new UserDTO(user.Id, user.Username, user.Password, user.Email, user.IsAdmin); return new UserDTO(user.Id, user.Username, user.Password, user.Email, user.IsAdmin);
} }
public static UserEntity FromModelToEntity(this User user) public static UserEntity FromModelToEntity(this User user)
{ {
return new UserEntity(user.Id, user.Username, user.Password, user.Email, user.IsAdmin); return new UserEntity
{
Id = user.Id,
Username = user.Username,
Password = user.Password,
Email = user.Email,
IsAdmin = user.IsAdmin
};
} }
} }

@ -35,7 +35,7 @@ public class SuccessDataService : ISuccessDataService
break; break;
} }
var successes = query.ToList(); var successes = query.ToList();
return successes.Select(s => s.FromEntityToDTO()); return successes.Select(s => s.FromEntityToDto());
} }
public SuccessDTO GetSuccessByUserId(int id) public SuccessDTO GetSuccessByUserId(int id)
@ -46,7 +46,7 @@ public class SuccessDataService : ISuccessDataService
throw new ArgumentException("Impossible de trouver le succès", nameof(id)); throw new ArgumentException("Impossible de trouver le succès", nameof(id));
} }
return userEntity.FromEntityToDTO(); return userEntity.FromEntityToDto();
} }
public SuccessDTO GetSuccessByInquiryId(int id) public SuccessDTO GetSuccessByInquiryId(int id)
@ -57,7 +57,7 @@ public class SuccessDataService : ISuccessDataService
throw new ArgumentException("Impossible de trouver le succès", nameof(id)); throw new ArgumentException("Impossible de trouver le succès", nameof(id));
} }
return userEntity.FromEntityToDTO(); return userEntity.FromEntityToDto();
} }
public bool DeleteSuccess(int id) public bool DeleteSuccess(int id)
@ -85,7 +85,7 @@ public class SuccessDataService : ISuccessDataService
updatingSuccess.InquiryId = success.InquiryId; updatingSuccess.InquiryId = success.InquiryId;
updatingSuccess.IsFinished = success.IsFinished; updatingSuccess.IsFinished = success.IsFinished;
DbContext.SaveChangesAsync(); DbContext.SaveChangesAsync();
return updatingSuccess.FromEntityToDTO(); return updatingSuccess.FromEntityToDto();
} }
public SuccessDTO CreateSuccess(int userId, int inquiryId, bool isFinished) public SuccessDTO CreateSuccess(int userId, int inquiryId, bool isFinished)
@ -96,7 +96,7 @@ public class SuccessDataService : ISuccessDataService
InquiryId = inquiryId, InquiryId = inquiryId,
IsFinished = isFinished, IsFinished = isFinished,
}; };
DbContext.Successes.Add(newSuccessEntity.FromDTOToEntity()); DbContext.Successes.Add(newSuccessEntity.FromDtoToEntity());
DbContext.SaveChangesAsync(); DbContext.SaveChangesAsync();
return newSuccessEntity; return newSuccessEntity;
} }

@ -30,7 +30,7 @@ namespace Shared
throw new ArgumentException("Impossible de trouver l'utilisateur", nameof(id)); throw new ArgumentException("Impossible de trouver l'utilisateur", nameof(id));
} }
return userEntity.FromEntityToDTO(); return userEntity.FromEntityToDto();
} }
@ -42,7 +42,7 @@ namespace Shared
throw new ArgumentException("Impossible de trouver l'utilisateur", nameof(username)); throw new ArgumentException("Impossible de trouver l'utilisateur", nameof(username));
} }
return userEntity.FromEntityToDTO(); return userEntity.FromEntityToDto();
} }
@ -69,7 +69,7 @@ namespace Shared
break; break;
} }
var users = query.ToList(); var users = query.ToList();
return users.Select(s => s.FromEntityToDTO()); return users.Select(s => s.FromEntityToDto());
} }
public bool DeleteUser(int id) public bool DeleteUser(int id)
@ -99,7 +99,7 @@ namespace Shared
updatingUser.Email = user.Email; updatingUser.Email = user.Email;
updatingUser.IsAdmin = user.IsAdmin; updatingUser.IsAdmin = user.IsAdmin;
DbContext.SaveChangesAsync(); DbContext.SaveChangesAsync();
return updatingUser.FromEntityToDTO(); return updatingUser.FromEntityToDto();
} }
@ -112,7 +112,7 @@ namespace Shared
Email = email, Email = email,
IsAdmin = isAdmin IsAdmin = isAdmin
}; };
DbContext.Users.Add(newUserEntity.FromDTOToEntity()); DbContext.Users.Add(newUserEntity.FromDtoToEntity());
DbContext.SaveChangesAsync(); DbContext.SaveChangesAsync();
return newUserEntity; return newUserEntity;

@ -17,36 +17,71 @@ public class StubbedContext : UserDbContext
{ {
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
modelBuilder.Entity<UserEntity>().HasData( modelBuilder.Entity<UserEntity>().HasData(
new UserEntity(1, "johnny", Convert.ToBase64String(KeyDerivation.Pbkdf2( new UserEntity
password: "motdepasse", {
salt: RandomNumberGenerator.GetBytes(128 / 8), Id = 1,
prf: KeyDerivationPrf.HMACSHA256, Username = "johnny",
iterationCount: 100000, Password = Convert.ToBase64String(KeyDerivation.Pbkdf2(
numBytesRequested: 256 / 8)), "Johnny.RATTON@etu.uca.fr", true), password: "motdepasse",
new UserEntity(2, "maxime", Convert.ToBase64String(KeyDerivation.Pbkdf2( salt: RandomNumberGenerator.GetBytes(128 / 8),
password: "motdepasse", prf: KeyDerivationPrf.HMACSHA256,
salt: RandomNumberGenerator.GetBytes(128 / 8), iterationCount: 100000,
prf: KeyDerivationPrf.HMACSHA256, numBytesRequested: 256 / 8)),
iterationCount: 100000, Email = "Johnny.RATTON@etu.uca.fr",
numBytesRequested: 256 / 8)), "Maxime.SAPOUNTZIS@etu.uca.fr", true), IsAdmin = true
new UserEntity(3, "clement", Convert.ToBase64String(KeyDerivation.Pbkdf2( },
password: "motdepasse", new UserEntity
salt: RandomNumberGenerator.GetBytes(128 / 8), {
prf: KeyDerivationPrf.HMACSHA256, Id = 2,
iterationCount: 100000, Username = "maxime",
numBytesRequested: 256 / 8)), "Clement.CHIEU@etu.uca.fr", true), Password = Convert.ToBase64String(KeyDerivation.Pbkdf2(
new UserEntity(4, "erwan", Convert.ToBase64String(KeyDerivation.Pbkdf2( password: "motdepasse",
password: "motdepasse", salt: RandomNumberGenerator.GetBytes(128 / 8),
salt: RandomNumberGenerator.GetBytes(128 / 8), prf: KeyDerivationPrf.HMACSHA256,
prf: KeyDerivationPrf.HMACSHA256, iterationCount: 100000,
iterationCount: 100000, numBytesRequested: 256 / 8)),
numBytesRequested: 256 / 8)), "Erwan.MENAGER@etu.uca.fr", true), Email = "Maxime.SAPOUNTZIS@etu.uca.fr",
new UserEntity(5, "victor", Convert.ToBase64String(KeyDerivation.Pbkdf2( IsAdmin = true
password: "motdepasse", },
salt: RandomNumberGenerator.GetBytes(128 / 8), new UserEntity
prf: KeyDerivationPrf.HMACSHA256, {
iterationCount: 100000, Id = 3,
numBytesRequested: 256 / 8)), "Victor.GABORIT@etu.uca.fr", true)); Username = "clement",
Password = Convert.ToBase64String(KeyDerivation.Pbkdf2(
password: "motdepasse",
salt: RandomNumberGenerator.GetBytes(128 / 8),
prf: KeyDerivationPrf.HMACSHA256,
iterationCount: 100000,
numBytesRequested: 256 / 8)),
Email = "Clement.CHIEU@etu.uca.fr",
IsAdmin = true
},
new UserEntity
{
Id = 4,
Username = "erwan",
Password = Convert.ToBase64String(KeyDerivation.Pbkdf2(
password: "motdepasse",
salt: RandomNumberGenerator.GetBytes(128 / 8),
prf: KeyDerivationPrf.HMACSHA256,
iterationCount: 100000,
numBytesRequested: 256 / 8)),
Email = "Erwan.MENAGER@etu.uca.fr",
IsAdmin = true
},
new UserEntity
{
Id = 5,
Username = "victor",
Password = Convert.ToBase64String(KeyDerivation.Pbkdf2(
password: "motdepasse",
salt: RandomNumberGenerator.GetBytes(128 / 8),
prf: KeyDerivationPrf.HMACSHA256,
iterationCount: 100000,
numBytesRequested: 256 / 8)),
Email = "Victor.GABORIT@etu.uca.fr",
IsAdmin = true
});
modelBuilder.Entity<InquiryTableEntity>().HasData( modelBuilder.Entity<InquiryTableEntity>().HasData(
new InquiryTableEntity new InquiryTableEntity

@ -46,12 +46,19 @@ using (var db = new StubbedContext(options))
// Ajout d'un utilisateur // Ajout d'un utilisateur
Console.WriteLine("\nAjout du nouvel utilisateur"); Console.WriteLine("\nAjout du nouvel utilisateur");
var newUser = new UserEntity("le nouveau du groupe", Convert.ToBase64String(KeyDerivation.Pbkdf2( var newUser = new UserEntity
password: "motdepasse", {
salt: RandomNumberGenerator.GetBytes(128 / 8), Username = "le nouveau du groupe",
prf: KeyDerivationPrf.HMACSHA256, Password = Convert.ToBase64String(KeyDerivation.Pbkdf2(
iterationCount: 100000, password: "motdepasse",
numBytesRequested: 256 / 8)), "Efff.fffff@etu.uca.fr", true); salt: RandomNumberGenerator.GetBytes(128 / 8),
prf: KeyDerivationPrf.HMACSHA256,
iterationCount: 100000,
numBytesRequested: 256 / 8)),
Email = "Efff.fffff@etu.uca.fr",
IsAdmin = true
}
;
if (!users.Any(u => u.Username == newUser.Username)) if (!users.Any(u => u.Username == newUser.Username))
{ {
users.Add(newUser); users.Add(newUser);

@ -1,49 +1,64 @@
using Entities; using Entities;
namespace TestEF; namespace TestEF.EntitiesTests;
public class TestNotepadEntity public class TestNotepadEntity
{ {
private const int _id = 42; private const int Id = 42;
private const int _userId = 42; private const int UserId = 42;
private static UserEntity _userEntity = new UserEntity(); private static readonly UserEntity UserEntity = new();
private const int _inquiryId = 42; private const int InquiryId = 42;
private static InquiryEntity _inquiryEntity = new InquiryEntity(); private static readonly InquiryEntity InquiryEntity = new();
private const string _notes = "This is some notes example"; private const string Notes = "This is some notes example";
[Fact] [Fact]
public void TestDefaultConstructor() public void TestDefaultConstructor()
{ {
NotepadEntity notepad = new NotepadEntity(); NotepadEntity notepad = new NotepadEntity();
Assert.Equal(0,notepad.Id); Assert.Equal(0, notepad.Id);
Assert.Equal(0,notepad.UserId); Assert.Equal(0, notepad.UserId);
Assert.Null(notepad.User); Assert.Null(notepad.User);
Assert.Equal(0,notepad.InquiryId); Assert.Equal(0, notepad.InquiryId);
Assert.Null(notepad.Inquiry); Assert.Null(notepad.Inquiry);
Assert.Null(notepad.Notes); Assert.Null(notepad.Notes);
} }
[Fact] [Fact]
public void TestConstructorWithoutId() public void TestConstructorWithoutId()
{ {
NotepadEntity notepad = new NotepadEntity(_userId,_userEntity,_inquiryId,_inquiryEntity,_notes); NotepadEntity notepad = new NotepadEntity
Assert.Equal(0,notepad.Id); {
Assert.Equal(_userId,notepad.UserId); UserId = UserId,
Assert.Equal(_userEntity,notepad.User); User = UserEntity,
Assert.Equal(_inquiryId,notepad.InquiryId); InquiryId = InquiryId,
Assert.Equal(_inquiryEntity,notepad.Inquiry); Inquiry = InquiryEntity,
Assert.Equal(_notes,notepad.Notes); Notes = Notes
};
Assert.Equal(0, notepad.Id);
Assert.Equal(UserId, notepad.UserId);
Assert.Equal(UserEntity, notepad.User);
Assert.Equal(InquiryId, notepad.InquiryId);
Assert.Equal(InquiryEntity, notepad.Inquiry);
Assert.Equal(Notes, notepad.Notes);
} }
[Fact] [Fact]
public void TestConstructorWithAllAttributes() public void TestConstructorWithAllAttributes()
{ {
NotepadEntity notepad = new NotepadEntity(_id,_userId,_userEntity,_inquiryId,_inquiryEntity,_notes); NotepadEntity notepad = new NotepadEntity
Assert.Equal(_id,notepad.Id); {
Assert.Equal(_userId,notepad.UserId); Id = Id,
Assert.Equal(_userEntity,notepad.User); UserId = UserId,
Assert.Equal(_inquiryId,notepad.InquiryId); User = UserEntity,
Assert.Equal(_inquiryEntity,notepad.Inquiry); InquiryId = InquiryId,
Assert.Equal(_notes,notepad.Notes); Inquiry = InquiryEntity,
Notes = Notes
};
Assert.Equal(Id, notepad.Id);
Assert.Equal(UserId, notepad.UserId);
Assert.Equal(UserEntity, notepad.User);
Assert.Equal(InquiryId, notepad.InquiryId);
Assert.Equal(InquiryEntity, notepad.Inquiry);
Assert.Equal(Notes, notepad.Notes);
} }
} }

@ -1,56 +1,69 @@
using Entities; using Entities;
namespace TestEF namespace TestEF.EntitiesTests;
public class TestUserEntity
{ {
public class TestUserEntity private const string Username = "username";
private const string Email = "example@email.com";
private const string Password = "password";
private const bool IsAdmin = true;
private const int Id = 42;
[Fact]
public void TestDefaultConstructor()
{ {
private const string _username = "username"; UserEntity user = new UserEntity();
private const string _email = "example@email.com"; Assert.Equal(0, user.Id);
private const string _password = "password"; Assert.Null(user.Username);
private const bool _isAdmin = true; Assert.Null(user.Email);
private const int _id = 42; Assert.Null(user.Password);
[Fact] Assert.False(user.IsAdmin);
public void TestDefaultConstructor() }
{
UserEntity user = new UserEntity();
Assert.Equal(0,user.Id);
Assert.Null(user.Username);
Assert.Null(user.Email);
Assert.Null(user.Password);
Assert.False(user.IsAdmin);
}
[Fact] [Fact]
public void TestConstructorWithOnlyId() public void TestConstructorWithOnlyId()
{ {
UserEntity user = new UserEntity(_id); UserEntity user = new UserEntity{ Id = Id};
Assert.Equal(_id,user.Id); Assert.Equal(Id, user.Id);
Assert.Null(user.Username); Assert.Null(user.Username);
Assert.Null(user.Email); Assert.Null(user.Email);
Assert.Null(user.Password); Assert.Null(user.Password);
Assert.False(user.IsAdmin); Assert.False(user.IsAdmin);
} }
[Fact] [Fact]
public void TestConstructorWithoutId() public void TestConstructorWithoutId()
{
UserEntity user = new UserEntity
{ {
UserEntity user = new UserEntity(_username, _password, _email, _isAdmin); Username = Username,
Assert.Equal(0,user.Id); Password = Password,
Assert.Equal(_username, user.Username); Email = Email,
Assert.Equal(_email, user.Email); IsAdmin = IsAdmin
Assert.Equal(_password, user.Password); };
Assert.True(user.IsAdmin); Assert.Equal(0, user.Id);
} Assert.Equal(Username, user.Username);
Assert.Equal(Email, user.Email);
[Fact] Assert.Equal(Password, user.Password);
public void TestConstructorWithoutAllAttributes() Assert.True(user.IsAdmin);
}
[Fact]
public void TestConstructorWithoutAllAttributes()
{
UserEntity user = new UserEntity
{ {
UserEntity user = new UserEntity(_id, _username, _password, _email, _isAdmin); Id = Id,
Assert.Equal(_id,user.Id); Username = Username,
Assert.Equal(_username, user.Username); Password = Password,
Assert.Equal(_email, user.Email); Email = Email,
Assert.Equal(_password, user.Password); IsAdmin = IsAdmin
Assert.True(user.IsAdmin); };
} Assert.Equal(Id, user.Id);
Assert.Equal(Username, user.Username);
Assert.Equal(Email, user.Email);
Assert.Equal(Password, user.Password);
Assert.True(user.IsAdmin);
} }
} }
Loading…
Cancel
Save