public async Task GetDecisionListTest_ReturnDecisionList() { //Arrange _repository.Setup(rep => rep.Decesion.GetAllAsync(It.IsAny <Expression <Func <Decesion, bool> > >(), It.IsAny <Func <IQueryable <Decesion>, IIncludableQueryable <Decesion, object> > >())) .ReturnsAsync(GetTestDecesionQueryable().AsEnumerable); //Act var decision = (await _decisionService.GetDecisionListAsync()).ToList(); //Assert Assert.IsInstanceOf <List <DecisionWrapperDTO> >(decision); }
public async Task GetDecisionListCountTest() { _decisionService = CreateDecisionService(); _repository.Setup(rep => rep.Decesion.GetAllAsync(It.IsAny <Expression <Func <Decesion, bool> > >(), It.IsAny <Func <IQueryable <Decesion>, IIncludableQueryable <Decesion, object> > >())) .ReturnsAsync(GetTestDecesionQueryable()); var decision = (await _decisionService.GetDecisionListAsync()).ToList(); Assert.Equal(GetTestDecisionsDtoList().Count, decision.Count); }
public async Task GetDecisionListTest() { _decisionService = CreateDecisionService(); _repository.Setup(rep => rep.Decesion.GetAllAsync(It.IsAny <Expression <Func <Decesion, bool> > >(), It.IsAny <Func <IQueryable <Decesion>, IIncludableQueryable <Decesion, object> > >())) .ReturnsAsync(GetTestDecesionQueryable().AsEnumerable); var decision = (await _decisionService.GetDecisionListAsync()).ToList(); Assert.IsType <List <DecisionWrapperDTO> >(decision); }