public static ShareClassService CreateShareClassService( IEnumerable <TbPrimeShareClass> testData, ApplicationDbContext context) { context.TbPrimeShareClass.AddRangeAsync(testData); context.SaveChangesAsync(); IAppRepository <TbPrimeShareClass> repository = new EfAppRepository <TbPrimeShareClass>(context); var service = new ShareClassService(repository); return(service); }
public ShareClassServiceTests() { this.testData = ShareClassTestData.GenerateShareClasses(); this.service = ShareClassTestData.CreateShareClassService(testData, base.context); }