Exemplo n.º 1
0
        public async Task GetDecisionOrganizationAsyncWithEmptyOrNullParameterTest(string organizationName)
        {
            //Arrange
            OrganizationDTO organization = GetTestOrganizationDtoList()[0];

            organization.OrganizationName = organizationName;
            _repository.Setup(rep => rep.Organization.GetFirstOrDefaultAsync(It.IsAny <Expression <Func <Organization, bool> > >(),
                                                                             It.IsAny <Func <IQueryable <Organization>, IIncludableQueryable <Organization, object> > >())).ReturnsAsync(new Organization()
            {
                ID = organization.ID
            });

            //Act
            var actualReturn = await _decisionService.GetDecisionOrganizationAsync(organization);

            //Assert
            Assert.AreEqual(organization.ID, actualReturn.ID);
        }
Exemplo n.º 2
0
        public async Task GetDecisionOrganizationAsyncWithRightParameterTest()
        {
            _decisionService = CreateDecisionService();
            OrganizationDTO organization = GetTestOrganizationDtoList()[0];

            _repository.Setup(rep => rep.Organization.GetFirstOrDefaultAsync(It.IsAny <Expression <Func <Organization, bool> > >(),
                                                                             It.IsAny <Func <IQueryable <Organization>, IIncludableQueryable <Organization, object> > >())).ReturnsAsync(new Organization()
            {
                OrganizationName = organization.OrganizationName
            });

            var actualReturn = await _decisionService.GetDecisionOrganizationAsync(organization);

            Assert.Equal(organization.OrganizationName, actualReturn.OrganizationName);
        }
        public async Task GetDecisionOrganizationAsyncWithEmptyOrNullParameterTest(string organizationName)
        {
            _decisionService = CreateDecisionService();
            GoverningBodyDTO organization = GetTestOrganizationDtoList()[0];

            organization.GoverningBodyName = organizationName;
            _repository.Setup(rep => rep.GoverningBody.GetFirstOrDefaultAsync(It.IsAny <Expression <Func <Organization, bool> > >(),
                                                                              It.IsAny <Func <IQueryable <Organization>, IIncludableQueryable <Organization, object> > >())).ReturnsAsync(new Organization()
            {
                ID = organization.Id
            });

            var actualReturn = await _decisionService.GetDecisionOrganizationAsync(organization);

            Assert.Equal(organization.Id, actualReturn.Id);
        }