示例#1
0
        public async Task All_ShouldReturnCorectData()
        {
            MapperInitializer.InitializeMapper();
            var context = ApplicationDbContextInMemoryFactory.InitializeContext();
            var seeder  = new Seeder();
            await seeder.SeedPatientAsync(context);

            var userManager    = this.GetUserManagerMock(context);
            var patientService = new PatientService(context, userManager.Object);

            var actualResult   = patientService.All().Result;
            var expectedResult = context.Patients;

            Assert.True(actualResult.Count() == expectedResult.Count());
            Assert.IsAssignableFrom <IQueryable <PatientServiceModel> >(actualResult);
        }