public void GetSkillsForOnetCodeTest(string onetSocCode) { var fakeLogger = A.Fake <IApplicationLogger>(); var fakeSocRepository = A.Fake <IRepository <SocCode> >(); var fakeDigitalSkillRepository = A.Fake <IRepository <DigitalSkill> >(); var fakeDigitalTranslationRepository = A.Fake <IRepository <FrameworkSkill> >(); using (OnetSkillsFramework dbcontext = new OnetSkillsFramework()) { var skillsRepository = new SkillsOueryRepository(dbcontext); var combinationRepository = new CombinationsQueryRepository(dbcontext); var suppressionRepository = new SuppressionsQueryRepository(dbcontext); var contentReferenceRepository = new ContentReferenceQueryRepository(dbcontext); ISkillFrameworkBusinessRuleEngine skillFrameworkBusinessRuleEngine = new SkillFrameworkBusinessRuleEngine( skillsRepository, suppressionRepository, combinationRepository, contentReferenceRepository); var skillsFrameworkService = new SkillsFrameworkService(fakeLogger, fakeSocRepository, fakeDigitalSkillRepository, fakeDigitalTranslationRepository, skillFrameworkBusinessRuleEngine); var result = skillsFrameworkService.GetRelatedSkillMapping(onetSocCode); result.Should().NotBeNull(); } }
public void GetAllTest() { //Setup var fakeDbContext = A.Fake <OnetSkillsFramework>(); var repo = new SuppressionsQueryRepository(fakeDbContext); var fakeSuppressionsDbSet = A.Fake <DbSet <DFC_GlobalAttributeSuppression> >(c => c .Implements(typeof(IQueryable <DFC_GlobalAttributeSuppression>)) .Implements(typeof(IDbAsyncEnumerable <DFC_GlobalAttributeSuppression>))) .SetupData(GetTestSuppressionTableData()); A.CallTo(() => fakeDbContext.DFC_GlobalAttributeSuppression).Returns(fakeSuppressionsDbSet); //Act var result = repo.GetAll(); //Assert result.Count().Should().Be(2); }