minor update (sexe string to char)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details

pull/10/head
David D'ALMEIDA 1 year ago
parent c5fd7c16a0
commit 9cddc06343

@ -12,7 +12,7 @@ public class UserDto
[MaxLength(100)] [MaxLength(100)]
public required string FirstName { get; set; } public required string FirstName { get; set; }
public required string Email { get; set; } public required string Email { get; set; }
public required string Sexe { get; set; } public required char Sexe { get; set; }
public float Lenght { get; set; } public float Lenght { get; set; }
public float Weight { get; set; } public float Weight { get; set; }
public string? Password { get; set; } public string? Password { get; set; }

@ -18,7 +18,7 @@ public class RegisterRequestDto
[EmailAddress] [EmailAddress]
public string Email { get; set; } public string Email { get; set; }
[Required(ErrorMessage = "Sexe is required")] [Required(ErrorMessage = "Sexe is required")]
public string Sexe { get; set; } public char Sexe { get; set; }
[Required(ErrorMessage = "Size is required")] [Required(ErrorMessage = "Size is required")]
public float Size { get; set; } public float Size { get; set; }
[Required(ErrorMessage = "Weight is required")] [Required(ErrorMessage = "Weight is required")]

@ -13,7 +13,7 @@ public class ResponseUserDto
[MaxLength(100)] [MaxLength(100)]
public required string FirstName { get; set; } public required string FirstName { get; set; }
public required string Email { get; set; } public required string Email { get; set; }
public required string Sexe { get; set; } public required char Sexe { get; set; }
public float Lenght { get; set; } public float Lenght { get; set; }
public float Weight { get; set; } public float Weight { get; set; }
public string? Password { get; set; } public string? Password { get; set; }

@ -12,7 +12,7 @@ public class UserTinyDto
[MaxLength(100)] [MaxLength(100)]
public required string FirstName { get; set; } public required string FirstName { get; set; }
public required string Email { get; set; } public required string Email { get; set; }
public required string Sexe { get; set; } public required char Sexe { get; set; }
public float Lenght { get; set; } public float Lenght { get; set; }
public float Weight { get; set; } public float Weight { get; set; }
public string? Password { get; set; } public string? Password { get; set; }

@ -59,7 +59,7 @@ namespace Entities
/// </summary> /// </summary>
[MaxLength(1)] [MaxLength(1)]
[Required(ErrorMessage = "Athlete Sexe is ")] [Required(ErrorMessage = "Athlete Sexe is ")]
public string Sexe { get; set; } public char Sexe { get; set; }
/// <summary> /// <summary>
/// Gets or sets the height of the athlete. /// Gets or sets the height of the athlete.

@ -9,7 +9,7 @@ public class User
public string FirstName { get; set; } public string FirstName { get; set; }
public string Email { get; set; } public string Email { get; set; }
public string? MotDePasse { get; set; } public string? MotDePasse { get; set; }
public string Sexe { get; set; } public char Sexe { get; set; }
public float Lenght { get; set; } public float Lenght { get; set; }
public float Weight { get; set; } public float Weight { get; set; }
public DateTime DateOfBirth { get; set; } public DateTime DateOfBirth { get; set; }
@ -22,7 +22,7 @@ public class User
public List<User> Users { get; set; } = new List<User>(); public List<User> Users { get; set; } = new List<User>();
public List<DataSource> DataSources { get; set; } = new List<DataSource>(); public List<DataSource> DataSources { get; set; } = new List<DataSource>();
public User( string username, string profilePicture, string nom, string prenom, string email, string motDePasse, string sexe, float taille, float poids, DateTime dateNaissance, Role role) public User( string username, string profilePicture, string nom, string prenom, string email, string motDePasse, char sexe, float taille, float poids, DateTime dateNaissance, Role role)
{ {
Username = username; Username = username;
ProfilePicture = profilePicture; ProfilePicture = profilePicture;

@ -13,21 +13,21 @@ public class UserService : IUserRepository
new User new User
{ {
Id = 1, Username = "DoeDoe", ProfilePicture = "https://images.unsplash.com/photo-1682687982134-2ac563b2228b?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", FirstName = "John", LastName = "Doe", Id = 1, Username = "DoeDoe", ProfilePicture = "https://images.unsplash.com/photo-1682687982134-2ac563b2228b?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", FirstName = "John", LastName = "Doe",
Sexe = "M", Lenght = 180, Weight = 70, DateOfBirth = new DateTime(1990, 1, 1), Sexe = 'M', Lenght = 180, Weight = 70, DateOfBirth = new DateTime(1990, 1, 1),
Email = "john.doe@example.com", Role = new Athlete() Email = "john.doe@example.com", Role = new Athlete()
}, },
new User new User
{ {
Id = 2, Username = "SmithSmith", ProfilePicture = "https://images.unsplash.com/photo-1709507779917-242b560288be?q=80&w=2080&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", FirstName = "Jane", LastName = "Smith", Id = 2, Username = "SmithSmith", ProfilePicture = "https://images.unsplash.com/photo-1709507779917-242b560288be?q=80&w=2080&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", FirstName = "Jane", LastName = "Smith",
Sexe = "F", Lenght = 170, Weight = 60, DateOfBirth = new DateTime(1992, 2, 2), Sexe = 'F', Lenght = 170, Weight = 60, DateOfBirth = new DateTime(1992, 2, 2),
Email = "athlete2@example.com", Role = new Coach() Email = "athlete2@example.com", Role = new Coach()
}, },
new User new User
{ {
Id = 3, Username = "Athlete3", ProfilePicture = "https://plus.unsplash.com/premium_photo-1705091981693-6006f8a20479?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", FirstName = "First3", LastName = "Last3", Id = 3, Username = "Athlete3", ProfilePicture = "https://plus.unsplash.com/premium_photo-1705091981693-6006f8a20479?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", FirstName = "First3", LastName = "Last3",
Sexe = "M", Lenght = 190, Weight = 80, DateOfBirth = new DateTime(1994, 3, 3), Email = "ath@ex.fr", Sexe = 'M', Lenght = 190, Weight = 80, DateOfBirth = new DateTime(1994, 3, 3), Email = "ath@ex.fr",
Role = new Athlete() Role = new Athlete()
} }

@ -42,11 +42,11 @@ namespace StubbedContextLib
modelBuilder.Entity<LargeImageEntity>().HasData(picture); modelBuilder.Entity<LargeImageEntity>().HasData(picture);
modelBuilder.Entity<AthleteEntity>().HasData( modelBuilder.Entity<AthleteEntity>().HasData(
new AthleteEntity { Id = 1, UserName = "Doe",ProfilPicture = picture2, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") ,LastName = "Doe", FirstName = "John", Email = "john.doe@example.com", PasswordHash = "password123", Sexe = "M", Length = 1.80, Weight = 75, DateOfBirth = new DateOnly(1990, 01, 01), IsCoach = true , DataSourceId = 1}, new AthleteEntity { Id = 1, UserName = "Doe",ProfilPicture = picture2, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") ,LastName = "Doe", FirstName = "John", Email = "john.doe@example.com", PasswordHash = "password123", Sexe = 'M', Length = 1.80, Weight = 75, DateOfBirth = new DateOnly(1990, 01, 01), IsCoach = true , DataSourceId = 1},
new AthleteEntity { Id = 2, UserName = "Smith",ProfilPicture = picture2,LastName = "Smith", FirstName = "Jane", Email = "jane.smith@exemple.com", PasswordHash = "secure456", Sexe = "F", Length = 1.65, Weight = 60, DateOfBirth = new DateOnly(1995, 01, 01), IsCoach = false, DataSourceId = 1 }, new AthleteEntity { Id = 2, UserName = "Smith",ProfilPicture = picture2,LastName = "Smith", FirstName = "Jane", Email = "jane.smith@exemple.com", PasswordHash = "secure456", Sexe = 'F', Length = 1.65, Weight = 60, DateOfBirth = new DateOnly(1995, 01, 01), IsCoach = false, DataSourceId = 1 },
new AthleteEntity { Id = 3, UserName = "Martin",ProfilPicture = picture2,ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") ,LastName = "Martin", FirstName = "Paul", Email = "paul.martin@example.com", PasswordHash = "super789", Sexe = "M", Length = 1.75, Weight = 68, DateOfBirth = new DateOnly(1992, 01, 01), IsCoach = true, DataSourceId = 1}, new AthleteEntity { Id = 3, UserName = "Martin",ProfilPicture = picture2,ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}") ,LastName = "Martin", FirstName = "Paul", Email = "paul.martin@example.com", PasswordHash = "super789", Sexe = 'M', Length = 1.75, Weight = 68, DateOfBirth = new DateOnly(1992, 01, 01), IsCoach = true, DataSourceId = 1},
new AthleteEntity { Id = 4, UserName = "Brown",ProfilPicture = picture2, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}"),LastName = "Brown", FirstName = "Anna", Email = "anna.brown@example.com", PasswordHash = "test000", Sexe = "F", Length = 1.70, Weight = 58, DateOfBirth = new DateOnly(1993, 01, 01), IsCoach = false, DataSourceId = 2 }, new AthleteEntity { Id = 4, UserName = "Brown",ProfilPicture = picture2, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}"),LastName = "Brown", FirstName = "Anna", Email = "anna.brown@example.com", PasswordHash = "test000", Sexe = 'F', Length = 1.70, Weight = 58, DateOfBirth = new DateOnly(1993, 01, 01), IsCoach = false, DataSourceId = 2 },
new AthleteEntity { Id = 5, UserName = "Lee", ProfilPicture = picture2, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}"),LastName = "Lee", FirstName = "Bruce", Email = "bruce.lee@example.com", PasswordHash = "hello321", Sexe = "M", Length = 2.0, Weight = 90, DateOfBirth = new DateOnly(1991, 01, 01), IsCoach = false, DataSourceId = 3 } new AthleteEntity { Id = 5, UserName = "Lee", ProfilPicture = picture2, ImageId = Guid.Parse("{8d121cdc-6787-4738-8edd-9e026ac16b65}"),LastName = "Lee", FirstName = "Bruce", Email = "bruce.lee@example.com", PasswordHash = "hello321", Sexe = 'M', Length = 2.0, Weight = 90, DateOfBirth = new DateOnly(1991, 01, 01), IsCoach = false, DataSourceId = 3 }
); );
} }
} }

@ -81,7 +81,7 @@ class Program
Console.WriteLine("Accès à l'athlete de sexe 'F' :"); Console.WriteLine("Accès à l'athlete de sexe 'F' :");
Console.WriteLine("---------------------------------"); Console.WriteLine("---------------------------------");
foreach (var athlete in db.AthletesSet.Where(a => a.Sexe == "F")) foreach (var athlete in db.AthletesSet.Where(a => a.Sexe == 'F'))
{ {
Console.WriteLine($"\t{athlete.Id} - {athlete.UserName}, {athlete.LastName}, {athlete.FirstName}, {athlete.Email}, {athlete.Sexe}, {athlete.Length}, {athlete.Weight}, {athlete.DateOfBirth}, {athlete.IsCoach}"); Console.WriteLine($"\t{athlete.Id} - {athlete.UserName}, {athlete.LastName}, {athlete.FirstName}, {athlete.Email}, {athlete.Sexe}, {athlete.Length}, {athlete.Weight}, {athlete.DateOfBirth}, {athlete.IsCoach}");
} }
@ -755,7 +755,7 @@ class Program
Console.WriteLine("Test d'ajout, de modification et de suppression des athletes :"); Console.WriteLine("Test d'ajout, de modification et de suppression des athletes :");
var picture = "https://davidalmeida.site/assets/me_avatar.f77af006.png"; var picture = "https://davidalmeida.site/assets/me_avatar.f77af006.png";
// Ajout d'un nouveau livre // Ajout d'un nouveau livre
var newAthlete = new AthleteEntity { UserName = "Doe", LastName = "Doe",ProfilPicture = picture,FirstName = "John", Email = "essaie.example.com", PasswordHash = "TheNewPassword", Sexe = "M", Length = 1.80, Weight = 90, DateOfBirth = new DateOnly(2024, 02, 22), IsCoach = false }; var newAthlete = new AthleteEntity { UserName = "Doe", LastName = "Doe",ProfilPicture = picture,FirstName = "John", Email = "essaie.example.com", PasswordHash = "TheNewPassword", Sexe = 'M', Length = 1.80, Weight = 90, DateOfBirth = new DateOnly(2024, 02, 22), IsCoach = false };
db.AthletesSet.Add(newAthlete); db.AthletesSet.Add(newAthlete);
db.SaveChanges(); db.SaveChanges();

@ -32,7 +32,7 @@ public class UsersControllerTest
ProfilePicture = ProfilePicture =
"https://images.unsplash.com/photo-1682687982134-2ac563b2228b?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", "https://images.unsplash.com/photo-1682687982134-2ac563b2228b?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
FirstName = "John", LastName = "Doe", FirstName = "John", LastName = "Doe",
Sexe = "M", Lenght = 180, Weight = 70, DateOfBirth = new DateTime(1990, 1, 1), Sexe = 'M', Lenght = 180, Weight = 70, DateOfBirth = new DateTime(1990, 1, 1),
Email = "john.doe@example.com", Role = new Athlete() Email = "john.doe@example.com", Role = new Athlete()
}, },
@ -42,7 +42,7 @@ public class UsersControllerTest
ProfilePicture = ProfilePicture =
"https://images.unsplash.com/photo-1709507779917-242b560288be?q=80&w=2080&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", "https://images.unsplash.com/photo-1709507779917-242b560288be?q=80&w=2080&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
FirstName = "Jane", LastName = "Smith", FirstName = "Jane", LastName = "Smith",
Sexe = "F", Lenght = 170, Weight = 60, DateOfBirth = new DateTime(1992, 2, 2), Sexe = 'F', Lenght = 170, Weight = 60, DateOfBirth = new DateTime(1992, 2, 2),
Email = "athlete2@example.com", Role = new Coach() Email = "athlete2@example.com", Role = new Coach()
}, },
@ -52,7 +52,7 @@ public class UsersControllerTest
ProfilePicture = ProfilePicture =
"https://plus.unsplash.com/premium_photo-1705091981693-6006f8a20479?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D", "https://plus.unsplash.com/premium_photo-1705091981693-6006f8a20479?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
FirstName = "First3", LastName = "Last3", FirstName = "First3", LastName = "Last3",
Sexe = "M", Lenght = 190, Weight = 80, DateOfBirth = new DateTime(1994, 3, 3), Email = "ath@ex.fr", Sexe = 'M', Lenght = 190, Weight = 80, DateOfBirth = new DateTime(1994, 3, 3), Email = "ath@ex.fr",
Role = new Athlete() Role = new Athlete()
} }
]; ];

@ -16,7 +16,7 @@ public class AthleteEntityTests (DatabaseFixture fixture) : IClassFixture<Databa
LastName = "Doe", LastName = "Doe",
FirstName = "John", FirstName = "John",
Email = "john.doe@example.com", Email = "john.doe@example.com",
Sexe = "M", Sexe = 'M',
Length = 180.0, Length = 180.0,
Weight = 75.5f, Weight = 75.5f,
PasswordHash = "password", PasswordHash = "password",
@ -51,7 +51,7 @@ public class AthleteEntityTests (DatabaseFixture fixture) : IClassFixture<Databa
LastName = "Smith", LastName = "Smith",
FirstName = "Jane", FirstName = "Jane",
Email = "jane.smith@example.com", Email = "jane.smith@example.com",
Sexe = "F", Sexe = 'F',
Length = 165.0, Length = 165.0,
Weight = 60.0f, Weight = 60.0f,
PasswordHash = "password123", PasswordHash = "password123",
@ -93,7 +93,7 @@ public class AthleteEntityTests (DatabaseFixture fixture) : IClassFixture<Databa
LastName = "Test", LastName = "Test",
FirstName = "User", FirstName = "User",
Email = "test.user@example.com", Email = "test.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "testpassword", PasswordHash = "testpassword",
@ -132,7 +132,7 @@ public class AthleteEntityTests (DatabaseFixture fixture) : IClassFixture<Databa
LastName = "Doe", LastName = "Doe",
FirstName = "John", FirstName = "John",
Email = "john.doe@example.com", Email = "john.doe@example.com",
Sexe = "M", Sexe = 'M',
Length = 180.0, Length = 180.0,
Weight = 75.5f, Weight = 75.5f,
PasswordHash = "password", PasswordHash = "password",
@ -156,7 +156,7 @@ public class AthleteEntityTests (DatabaseFixture fixture) : IClassFixture<Databa
Assert.Equal("Doe", savedAthlete.LastName); Assert.Equal("Doe", savedAthlete.LastName);
Assert.Equal("John", savedAthlete.FirstName); Assert.Equal("John", savedAthlete.FirstName);
Assert.Equal("john.doe@example.com", savedAthlete.Email); Assert.Equal("john.doe@example.com", savedAthlete.Email);
Assert.Equal("M", savedAthlete.Sexe); Assert.Equal('M', savedAthlete.Sexe);
Assert.Equal(180.0, savedAthlete.Length); Assert.Equal(180.0, savedAthlete.Length);
Assert.Equal(75.5f, savedAthlete.Weight); Assert.Equal(75.5f, savedAthlete.Weight);
Assert.Equal("password", savedAthlete.PasswordHash); Assert.Equal("password", savedAthlete.PasswordHash);
@ -174,7 +174,7 @@ public class AthleteEntityTests (DatabaseFixture fixture) : IClassFixture<Databa
LastName = null, LastName = null,
FirstName = null, FirstName = null,
Email = null, Email = null,
Sexe = null, Sexe = 'M',
Length = 0, Length = 0,
Weight = 0, Weight = 0,
PasswordHash = null, PasswordHash = null,

@ -16,7 +16,7 @@ public class FriendshipEntityTests (DatabaseFixture fixture) : IClassFixture<Dat
LastName = "Follower", LastName = "Follower",
FirstName = "User", FirstName = "User",
Email = "follower.user@example.com", Email = "follower.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "followerpassword", PasswordHash = "followerpassword",
@ -31,7 +31,7 @@ public class FriendshipEntityTests (DatabaseFixture fixture) : IClassFixture<Dat
LastName = "Following", LastName = "Following",
FirstName = "User", FirstName = "User",
Email = "following.user@example.com", Email = "following.user@example.com",
Sexe = "F", Sexe = 'F',
Length = 165.0, Length = 165.0,
Weight = 60.0f, Weight = 60.0f,
PasswordHash = "followingpassword", PasswordHash = "followingpassword",
@ -83,7 +83,7 @@ public class FriendshipEntityTests (DatabaseFixture fixture) : IClassFixture<Dat
LastName = "Follower", LastName = "Follower",
FirstName = "User", FirstName = "User",
Email = "follower.user@example.com", Email = "follower.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "followerpassword", PasswordHash = "followerpassword",
@ -97,7 +97,7 @@ public class FriendshipEntityTests (DatabaseFixture fixture) : IClassFixture<Dat
LastName = "Following", LastName = "Following",
FirstName = "User", FirstName = "User",
Email = "following.user@example.com", Email = "following.user@example.com",
Sexe = "F", Sexe = 'F',
Length = 165.0, Length = 165.0,
Weight = 60.0f, Weight = 60.0f,
PasswordHash = "followingpassword", PasswordHash = "followingpassword",
@ -111,7 +111,7 @@ public class FriendshipEntityTests (DatabaseFixture fixture) : IClassFixture<Dat
LastName = "Third", LastName = "Third",
FirstName = "User", FirstName = "User",
Email = "third.user@example.com", Email = "third.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 180.0, Length = 180.0,
Weight = 75.0f, Weight = 75.0f,
PasswordHash = "thirdpassword", PasswordHash = "thirdpassword",
@ -161,7 +161,7 @@ public class FriendshipEntityTests (DatabaseFixture fixture) : IClassFixture<Dat
LastName = "Follower", LastName = "Follower",
FirstName = "User", FirstName = "User",
Email = "follower.user@example.com", Email = "follower.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "followerpassword", PasswordHash = "followerpassword",
@ -175,7 +175,7 @@ public class FriendshipEntityTests (DatabaseFixture fixture) : IClassFixture<Dat
LastName = "Following", LastName = "Following",
FirstName = "User", FirstName = "User",
Email = "following.user@example.com", Email = "following.user@example.com",
Sexe = "F", Sexe = 'F',
Length = 165.0, Length = 165.0,
Weight = 60.0f, Weight = 60.0f,
PasswordHash = "followingpassword", PasswordHash = "followingpassword",

@ -16,7 +16,7 @@ public class NotificationEntityTests (DatabaseFixture fixture) : IClassFixture<D
LastName = "Sender", LastName = "Sender",
FirstName = "User", FirstName = "User",
Email = "sender.user@example.com", Email = "sender.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "senderpassword", PasswordHash = "senderpassword",
@ -59,7 +59,7 @@ public class NotificationEntityTests (DatabaseFixture fixture) : IClassFixture<D
LastName = "Sender", LastName = "Sender",
FirstName = "User", FirstName = "User",
Email = "sender.user@example.com", Email = "sender.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "senderpassword", PasswordHash = "senderpassword",
@ -109,7 +109,7 @@ public class NotificationEntityTests (DatabaseFixture fixture) : IClassFixture<D
LastName = "Sender", LastName = "Sender",
FirstName = "User", FirstName = "User",
Email = "sender.user@example.com", Email = "sender.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "senderpassword", PasswordHash = "senderpassword",
@ -158,7 +158,7 @@ public class NotificationEntityTests (DatabaseFixture fixture) : IClassFixture<D
LastName = "Sender", LastName = "Sender",
FirstName = "User", FirstName = "User",
Email = "sender.user@example.com", Email = "sender.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "senderpassword", PasswordHash = "senderpassword",

@ -16,7 +16,7 @@ public class StatisticEntityTests (DatabaseFixture fixture) : IClassFixture<Data
LastName = "Athlete", LastName = "Athlete",
FirstName = "User", FirstName = "User",
Email = "athlete.user@example.com", Email = "athlete.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "athletepassword", PasswordHash = "athletepassword",
@ -60,7 +60,7 @@ public class StatisticEntityTests (DatabaseFixture fixture) : IClassFixture<Data
LastName = "Athlete", LastName = "Athlete",
FirstName = "User", FirstName = "User",
Email = "athlete.user@example.com", Email = "athlete.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "athletepassword", PasswordHash = "athletepassword",
@ -111,7 +111,7 @@ public class StatisticEntityTests (DatabaseFixture fixture) : IClassFixture<Data
LastName = "Athlete", LastName = "Athlete",
FirstName = "User", FirstName = "User",
Email = "athlete.user@example.com", Email = "athlete.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "athletepassword", PasswordHash = "athletepassword",
@ -162,7 +162,7 @@ public class StatisticEntityTests (DatabaseFixture fixture) : IClassFixture<Data
LastName = "Athlete", LastName = "Athlete",
FirstName = "User", FirstName = "User",
Email = "athlete.user@example.com", Email = "athlete.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 170.0, Length = 170.0,
Weight = 70.0f, Weight = 70.0f,
PasswordHash = "athletepassword", PasswordHash = "athletepassword",

@ -16,7 +16,7 @@ public class TrainingEntityTests (DatabaseFixture fixture) : IClassFixture<Datab
LastName = "Coach", LastName = "Coach",
FirstName = "User", FirstName = "User",
Email = "coach.user@example.com", Email = "coach.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 180.0, Length = 180.0,
Weight = 75.0f, Weight = 75.0f,
PasswordHash = "coachpassword", PasswordHash = "coachpassword",
@ -31,7 +31,7 @@ public class TrainingEntityTests (DatabaseFixture fixture) : IClassFixture<Datab
LastName = "Athlete", LastName = "Athlete",
FirstName = "User", FirstName = "User",
Email = "athlete.user@example.com", Email = "athlete.user@example.com",
Sexe = "F", Sexe = 'F',
Length = 165.0, Length = 165.0,
Weight = 60.0f, Weight = 60.0f,
PasswordHash = "athletepassword", PasswordHash = "athletepassword",
@ -77,7 +77,7 @@ public class TrainingEntityTests (DatabaseFixture fixture) : IClassFixture<Datab
LastName = "Coach", LastName = "Coach",
FirstName = "User", FirstName = "User",
Email = "coach.user@example.com", Email = "coach.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 180.0, Length = 180.0,
Weight = 75.0f, Weight = 75.0f,
PasswordHash = "coachpassword", PasswordHash = "coachpassword",
@ -92,7 +92,7 @@ public class TrainingEntityTests (DatabaseFixture fixture) : IClassFixture<Datab
LastName = "Athlete", LastName = "Athlete",
FirstName = "User", FirstName = "User",
Email = "athlete.user@example.com", Email = "athlete.user@example.com",
Sexe = "F", Sexe = 'F',
Length = 165.0, Length = 165.0,
Weight = 60.0f, Weight = 60.0f,
PasswordHash = "athletepassword", PasswordHash = "athletepassword",
@ -145,7 +145,7 @@ public class TrainingEntityTests (DatabaseFixture fixture) : IClassFixture<Datab
LastName = "Coach", LastName = "Coach",
FirstName = "User", FirstName = "User",
Email = "coach.user@example.com", Email = "coach.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 180.0, Length = 180.0,
Weight = 75.0f, Weight = 75.0f,
PasswordHash = "coachpassword", PasswordHash = "coachpassword",
@ -160,7 +160,7 @@ public class TrainingEntityTests (DatabaseFixture fixture) : IClassFixture<Datab
LastName = "Athlete", LastName = "Athlete",
FirstName = "User", FirstName = "User",
Email = "athlete.user@example.com", Email = "athlete.user@example.com",
Sexe = "F", Sexe = 'F',
Length = 165.0, Length = 165.0,
Weight = 60.0f, Weight = 60.0f,
PasswordHash = "athletepassword", PasswordHash = "athletepassword",
@ -212,7 +212,7 @@ public class TrainingEntityTests (DatabaseFixture fixture) : IClassFixture<Datab
LastName = "Coach", LastName = "Coach",
FirstName = "User", FirstName = "User",
Email = "coach.user@example.com", Email = "coach.user@example.com",
Sexe = "M", Sexe = 'M',
Length = 180.0, Length = 180.0,
Weight = 75.0f, Weight = 75.0f,
PasswordHash = "coachpassword", PasswordHash = "coachpassword",
@ -227,7 +227,7 @@ public class TrainingEntityTests (DatabaseFixture fixture) : IClassFixture<Datab
LastName = "Athlete", LastName = "Athlete",
FirstName = "User", FirstName = "User",
Email = "athlete.user@example.com", Email = "athlete.user@example.com",
Sexe = "F", Sexe = 'F',
Length = 165.0, Length = 165.0,
Weight = 60.0f, Weight = 60.0f,
PasswordHash = "athletepassword", PasswordHash = "athletepassword",

@ -10,7 +10,7 @@ namespace Model.Tests
{ {
var athlete = new Athlete(); var athlete = new Athlete();
var user = new User("hello13", "dkjd.png", "John", "Doe", "john@exemple.com", "password", "Male", 180.5f, 75.3f, new System.DateTime(1990, 5, 15), new Athlete()); var user = new User("hello13", "dkjd.png", "John", "Doe", "john@exemple.com", "password", 'M', 180.5f, 75.3f, new System.DateTime(1990, 5, 15), new Athlete());
var result = athlete.CheckAdd(user); var result = athlete.CheckAdd(user);
Assert.True(result); Assert.True(result);
@ -21,7 +21,7 @@ namespace Model.Tests
{ {
var athlete = new Athlete(); var athlete = new Athlete();
var user = new User("hello13", "dkjd.png", "John", "Doe", "john@exemple.com", "password", "Male", 180.5f, 75.3f, new System.DateTime(1990, 5, 15), new Coach()); var user = new User("hello13", "dkjd.png", "John", "Doe", "john@exemple.com", "password", 'M', 180.5f, 75.3f, new System.DateTime(1990, 5, 15), new Coach());
var result = athlete.CheckAdd(user); var result = athlete.CheckAdd(user);
Assert.False(result); Assert.False(result);

@ -8,7 +8,7 @@ namespace Model.Tests
public void AddUser_WithValidUser_ReturnsTrue() public void AddUser_WithValidUser_ReturnsTrue()
{ {
var role = new Athlete(); var role = new Athlete();
var user = new User("hello13", "dkjd.png", "John", "Doe", "john@exemple.com", "password", "M", 180.5f, 75.3f, new System.DateTime(1990, 5, 15), new Athlete()); var user = new User("hello13", "dkjd.png", "John", "Doe", "john@exemple.com", "password", 'M', 180.5f, 75.3f, new System.DateTime(1990, 5, 15), new Athlete());
bool result = role.AddUser(user); bool result = role.AddUser(user);

@ -13,7 +13,7 @@ namespace Model.Tests
string firstName = "John"; string firstName = "John";
string email = "john.doe@example.com"; string email = "john.doe@example.com";
string password = "password"; string password = "password";
string sex = "Male"; char sex = 'M';
float length = 180.5f; float length = 180.5f;
float weight = 75.3f; float weight = 75.3f;
DateTime dateOfBirth = new DateTime(1990, 5, 15); DateTime dateOfBirth = new DateTime(1990, 5, 15);

Loading…
Cancel
Save