private async Task <Partner> CreatePartnerAsync(TestCase testCase) { using (testCase.BeginScope()) { var unitOfWork = testCase.GetService <IUnitOfWork>(); var localeRepository = testCase.GetService <ILocaleRepository>(); var partner = new Partner { Name = Guid.NewGuid().ToString() }; var locales = await localeRepository.GetLocalesAsync(); partner.AddLocales(locales); var partnerRepository = testCase.GetService <IPartnerRepository>(); partnerRepository.AddPartner(partner); await unitOfWork.SaveChangesAsync(); return(partner); } }