public async Task GetMainCategegoryIdBySubCategoryId_ThrowsExceptionIfIdIsNull() { var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var subCategoryRepository = new EfDeletableEntityRepository <SubCategory>(context); var subCategoryService = new SubCategoryService(subCategoryRepository); await Assert.ThrowsAsync <ArgumentNullException>(async() => { await subCategoryService.GetMainCategoryNameBySubCategoryId(null); }); }