public async Task <bool> Update(string catalogueId, int companyId, UpdateCompanyDetailModel updatedCompanyDetail)
        {
            bool isSuccess = false;

            if (_updateCompanyDetailsValidation.IsValid(catalogueId, companyId, updatedCompanyDetail))
            {
                await _updateCompanyDetailsRepository.Update(catalogueId, companyId, updatedCompanyDetail);

                isSuccess = true;
            }
            return(isSuccess);
        }
Exemple #2
0
        public void Validation_Test_1()
        {
            string catalogueId = "1a";
            int    companyId   = 1;
            UpdateCompanyDetailModel updatedCompanyDetail = new UpdateCompanyDetailModel
            {
                CompanyName       = "Hooli",
                NumberOfEmployees = 5,
                TotalRevenues     = 10,
                WebSite           = "hooli.xyz"
            };

            _mockCompanyUpdateModelValidation
            .Setup(x => x.IsModelValid(It.IsAny <UpdateCompanyDetailModel>()))
            .Returns(true);
            var result = _updateCompanyDetailsValidation.IsValid(catalogueId, companyId, updatedCompanyDetail);

            Assert.IsTrue(result);
        }