//----------------------------------------------------------------------- // FILENAME: AthleteStubbedContext.cs // PROJECT: StubbedContextLib // SOLUTION: HeartTrack // DATE CREATED: 22/02/2024 // AUTHOR: Antoine PEREDERII //----------------------------------------------------------------------- using DbContextLib; using Entities; using Microsoft.EntityFrameworkCore; namespace StubbedContextLib { /// /// Represents the stubbed context for athletes. /// public class AthleteStubbedContext : ActivityStubbedContext { /// /// Initializes a new instance of the class. /// public AthleteStubbedContext() : base() { } /// /// Initializes a new instance of the class with the specified options. /// /// The options for the context. public AthleteStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the athlete stubbed context. /// /// The model builder instance. protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity().HasData( new AthleteEntity { IdAthlete = 1, Username = "Doe", LastName = "Doe", FirstName = "John", Email = "john.doe@example.com", Password = "password123", Sexe = "M", Length = 1.80, Weight = 75, DateOfBirth = new DateOnly(1990, 01, 01), IsCoach = true }, new AthleteEntity { IdAthlete = 2, Username = "Smith", LastName = "Smith", FirstName = "Jane", Email = "jane.smith@exemple.com", Password = "secure456", Sexe = "F", Length = 1.65, Weight = 60, DateOfBirth = new DateOnly(1995, 01, 01), IsCoach = false }, new AthleteEntity { IdAthlete = 3, Username = "Martin", LastName = "Martin", FirstName = "Paul", Email = "paul.martin@example.com", Password = "super789", Sexe = "M", Length = 1.75, Weight = 68, DateOfBirth = new DateOnly(1992, 01, 01), IsCoach = true }, new AthleteEntity { IdAthlete = 4, Username = "Brown", LastName = "Brown", FirstName = "Anna", Email = "anna.brown@example.com", Password = "test000", Sexe = "F", Length = 1.70, Weight = 58, DateOfBirth = new DateOnly(1993, 01, 01), IsCoach = false }, new AthleteEntity { IdAthlete = 5, Username = "Lee", LastName = "Lee", FirstName = "Bruce", Email = "bruce.lee@example.com", Password = "hello321", Sexe = "M", Length = 2.0, Weight = 90, DateOfBirth = new DateOnly(1991, 01, 01), IsCoach = false } ); } } }