public void GetOpportunityTypeById_ArgumentNullException()
        {
            var opportunityTypeId = 1;

            var repo = new OpportunityTypeRepository(_configurationMock.Object, _repositoryConnectionMock.Object);

            var result = repo.GetOpportunityTypeById(opportunityTypeId);

            Assert.IsNull(result);
        }
Example #2
0
        public void GetOpportunityTypeById_Null()
        {
            //Arrange
            var opportunityTypeId = 1;

            //Action
            var repo   = new OpportunityTypeRepository(_configurationMock.Object, _repositoryConnectionMock.Object);
            var result = repo.GetOpportunityTypeById(opportunityTypeId);

            //Assert
            Assert.IsNull(result);
        }
        public void GetOpportunityTypeById_ArgumentException()
        {
            var jsonDataTable = @"[{}]";

            var opportunityTypeId = 1;

            _repositoryConnectionMock.Setup(x => x.SearchCommand("GetOpportunityTypeById", It.IsAny <Dictionary <string, string> >())).Returns(jsonDataTable);

            var repo = new OpportunityTypeRepository(_configurationMock.Object, _repositoryConnectionMock.Object);

            var result = repo.GetOpportunityTypeById(opportunityTypeId);

            Assert.IsNull(result);
        }
        public void GetOpportunityTypeById_Ok()
        {
            var jsonDataTable     = @"[
                    {
                        'opportunityTypeId': '1',
                        'opportunityName': 'teste',
                        'DateRegister': '2021-05-05T00:00:00',
                        'opportunityTypeStatus': 'true',
                    }    
                ]";
            var opportunityTypeId = 1;

            _repositoryConnectionMock.Setup(x => x.SearchCommand("GetOpportunityTypeById", It.IsAny <Dictionary <string, string> >())).Returns(jsonDataTable);

            var repo = new OpportunityTypeRepository(_configurationMock.Object, _repositoryConnectionMock.Object);

            var result = repo.GetOpportunityTypeById(opportunityTypeId);

            Assert.IsNotNull(result);
        }