public void seedProgram(int number) { programPoco[] programs = new programPoco[number]; for (int i = 0; i < number; i++) { programs[i] = new programPoco { programID = Guid.NewGuid(), programDescription = "testProgram " + i, capacity = i }; } commandObjectReferance.add <programPoco>(programs); }
public void seedClass() { programPoco crossfitPoco = queryObjectReferace.GetSingle <programPoco>(pp => pp.programDescription == "crossfit"); if (crossfitPoco == null) { new SeedProgramForTesting(commandObjectReferance, queryObjectReferace).seedProgram(); } programPoco crossfitProgram = queryObjectReferace.GetSingle <programPoco>(pp => pp.programDescription == "crossfit"); commandObjectReferance.add <classPoco>( new classPoco { classID = Guid.NewGuid(), programID = crossfitProgram.programID, } ); }
public void seedBooking() { userPoco TestUserWithCredentails = queryObjectReferace.GetSingle <userPoco>(up => up.emailAddress == "*****@*****.**", up => up.userCredentialsListNavigation); programPoco TestProgramWithClassList = queryObjectReferace.GetSingle <programPoco>(pp => pp.programDescription == "crossfit", pp => pp.classesListNavigation); if (TestUserWithCredentails == null || TestProgramWithClassList.classesListNavigation == null) { new SeedProgramForTesting(commandObjectReferance, queryObjectReferace).seedProgram(); new SeedClassForTesting(commandObjectReferance, queryObjectReferace).seedClass(); } TestUserWithCredentails = queryObjectReferace.GetSingle <userPoco>(up => up.emailAddress == "*****@*****.**", up => up.userCredentialsListNavigation); TestProgramWithClassList = queryObjectReferace.GetSingle <programPoco>(pp => pp.programDescription == "crossfit", pp => pp.classesListNavigation); bookingPoco testBookingPoco = new bookingPoco { bookingID = Guid.NewGuid(), classID = TestProgramWithClassList.classesListNavigation.FirstOrDefault <classPoco>().classID, UserID = TestUserWithCredentails.userCredentialsListNavigation.FirstOrDefault <userCredentialsPoco>().userID, isWaitlisted = false }; }