public BasePaedListVMTest() { _seed = Guid.NewGuid().ToString(); _studentListVM = new BasePagedListVM <Student, BaseSearcher>(); _studentListVM.DC = new DataContext(_seed, DBTypeEnum.Memory); for (int i = 1; i <= 20; i++) { _studentListVM.DC.Set <Student>().Add(new Student { LoginName = "s" + i.ToString("00"), Password = "******", Name = "n" + (int)(i / 10), IsValid = true }); } _studentListVM.DC.SaveChanges(); }
public BasePaedListVMTest() { Mock <IServiceProvider> mockService = new Mock <IServiceProvider>(); mockService.Setup(x => x.GetService(typeof(GlobalData))).Returns(new GlobalData()); mockService.Setup(x => x.GetService(typeof(Configs))).Returns(new Configs()); GlobalServices.SetServiceProvider(mockService.Object); _seed = Guid.NewGuid().ToString(); _studentListVM = new BasePagedListVM <Student, BaseSearcher>(); _studentListVM.DC = new DataContext(_seed, DBTypeEnum.Memory); for (int i = 1; i <= 20; i++) { _studentListVM.DC.Set <Student>().Add(new Student { LoginName = "s" + i.ToString("00"), Password = "******", Name = "n" + (int)(i / 10), IsValid = true }); } _studentListVM.DC.SaveChanges(); }