public async Task GetAllWithNoTracking_ReturnKeyWithBookingTrue() { //Arrange User user = new User(); //Action var collection = await keyObjectService.GetAll(x => x.IsBooked == true); user = collection.First().User; //Assert Assert.IsTrue(collection.Count() > 0); }
/// <summary> /// Get all( dexterity method) /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public async Task <IEnumerable <DomainObject> > GetAll <T>() where T : DomainObject { if (typeof(T) == typeof(User)) { return(await _userService.GetAll()); } else if (typeof(T) == typeof(KeyObject)) { return(await _keyService.GetAll()); } else if (typeof(T) == typeof(BookingAction)) { return(await _bookingAction.GetAllFullValue()); } else if (typeof(T) == typeof(Permission)) { return(await _permissionService.GetAllWithUserCollectionAndKey()); } throw new ArgumentException(); }