Esempio n. 1
0
        public void SiteGetResponseToIesSiteGetModelMapper_MappingTest_Valid()
        {
            //1. setup data
            var source = IesContractTestDataHelper.CreateDummySiteDetails("0ESJD2");

            //2. exec
            var dest = MappingEngine.Map <IesSiteGetModel>(source);

            //3. verify
            Assert.AreEqual(source.SiteCode, dest.SiteCode);
            Assert.AreEqual(source.SiteCodeDescription, dest.SiteCodeDescription);
            Assert.AreEqual(source.AddressLine1, dest.AddressLine1);
            Assert.AreEqual(source.AddressLine2, dest.AddressLine2);
            Assert.AreEqual(source.AddressLine3, dest.AddressLine3);
            Assert.AreEqual(source.Locality, dest.Locality);
            Assert.AreEqual(source.State, dest.State);
            Assert.AreEqual(source.Postcode, dest.Postcode);
            Assert.AreEqual(source.AreaCode, dest.AreaCode);
            Assert.AreEqual(source.PhoneNumber, dest.PhoneNumber);
            Assert.AreEqual(source.FaxNumber, dest.FaxNumber);
            Assert.AreEqual(source.FreeCallNumber, dest.FreeCallNumber);
            Assert.AreEqual(source.Email, dest.Email);
            Assert.AreEqual(source.ContactPerson, dest.ContactPerson);
            Assert.AreEqual(source.OfficeTypeCode, dest.OfficeTypeCode);
            Assert.AreEqual(source.OfficeTypeDescription, dest.OfficeTypeDescription);
            Assert.AreEqual(source.OrganisationCode, dest.OrganisationCode);
            Assert.AreEqual(source.OrganisationDescription, dest.OrganisationDescription);
            Assert.AreEqual(source.ManagingSiteCode, dest.ManagingSiteCode);
            Assert.AreEqual(source.ManagingSiteDescription, dest.ManagingSiteDescription);
            Assert.AreEqual(source.SiteSPIndicatorCode, dest.SiteSpIndicatorCode);
            Assert.AreEqual(source.AddressDisocsCd, dest.AddressDisocsCd);
            Assert.AreEqual(source.AddressType, dest.AddressType);
            Assert.AreEqual(source.AddressOfficeType, dest.AddressOfficeType);
            Assert.AreEqual(source.AddressLocationNm, dest.AddressLocationNm);
        }
Esempio n. 2
0
        public void OutletUpdateNEIS_WcfThrowsFaultException_ThrowsServiceValidationException()
        {
            var exception = IesContractTestDataHelper.CreateDummyFaultException();

            //1. Setup data
            //a.request
            IesOutletUpdateNEISRequestModel request = new IesOutletUpdateNEISRequestModel
            {
                CheckRelatedOutletFlag = "N",
                ContactName            = "TBA",
                ContractId             = "0205881K",
                EmailAddress           = null,
                EndDate   = new DateTime(2015, 6, 30),
                FaxNumber = null,
                IntegrityControlNumber = 118,
                MobileNumber           = null,
                PhoneNumber            = "0123456789",
                ProviderText           = "abc",
                RelatedOutlets         = null,
                SequenceNumber         = 1,
                StartDate           = new DateTime(2009, 4, 2),
                SupervisingOffice   = "QLPU",
                SuspendRefsFromDate = DateTime.MinValue
            };

            mockOutletUpdateWcf.Setup(m => m.UpdateOutletNEIS(It.IsAny <OutletUpdateNEISRequest>())).Throws(exception);

            //2. exec
            var result = SystemUnderTest().UpdateOutletNEIS(request);
        }
Esempio n. 3
0
        public void OutOutletRegionToOutletRegion_MappingTest_Valid()
        {
            //TODO: Finish writing unit test

            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyOutOutletRegion("0ESJD2");

            //2. exec
            var dest = MappingEngine.Map <IesOutletRegion>(source);

            //3. verify
            Assert.AreEqual(source.AdditionalInformation, dest.AdditionalInformation);
            Assert.AreEqual(source.AssessorAvailFl, dest.AvailableFlag);
            Assert.AreEqual(source.ContactName, dest.ContactName);
            Assert.AreEqual(source.ContactPhone, dest.ContactPhone);
            Assert.AreEqual(source.CreationDate, dest.CreationDate);
            Assert.AreEqual(source.CreationTime, dest.CreationTime);
            Assert.AreEqual(source.CreationUserId, dest.CreationUserId);
            Assert.AreEqual(source.CurrentAssmntCnt, dest.CurrentAssessmentCount);
            Assert.AreEqual(source.IntegrityControlNumber, dest.IntegrityControlNumber);
            Assert.AreEqual(source.PartRegnCoverFl, dest.PartialCoverageFlag);
            Assert.AreEqual(source.RegionCode, dest.RegionCode);
            Assert.AreEqual(source.RegionDescription, dest.RegionDescription);
            Assert.AreEqual(source.RegionType, dest.RegionType);
            Assert.AreEqual(source.UpdateDate, dest.UpdateDate);
            Assert.AreEqual(source.UpdateTime, dest.UpdateTime);
            Assert.AreEqual(source.UpdateUserId, dest.UpdateUserId);
        }
Esempio n. 4
0
        public void ContractList_Valid()
        {
            //1. Setup data
            //a.request
            var request = IesContractTestDataHelper.CreateDummyContractListModel();
            //b.response
            List <OutContractSearchGroup> contractLists = new List <OutContractSearchGroup>();

            for (int i = 1; i < 10; i++)
            {
                contractLists.Add(IesContractTestDataHelper.CreateDummyContract(i));
            }

            var response = new ContractSearchResponse
            {
                MoreFlag         = "Y",
                NextContractId   = "123456789A",
                OutContractGroup = contractLists.ToArray()
            };

            mockContractSearchWcf.Setup(m => m.ContractSearch(It.IsAny <ContractSearchRequest>())).Returns(response);

            //2. exec
            var result = SystemUnderTest().ListContracts(request);

            //3. Verification
            //Verify More parameters
            Assert.AreEqual(true, result.HasMoreRecords);
            Assert.AreEqual(response.NextContractId, result.NextContractId);
            //Verify response list
            Assert.AreEqual(response.OutContractGroup.Length, result.Results.Count());

            //Verify behaviour
            mockContractSearchWcf.Verify(m => m.ContractSearch(It.Is <ContractSearchRequest>(r => r.ContractType == request.ContractType)), Times.Once());
        }
Esempio n. 5
0
        public void ContractSearchResponseToContractListModel_MappingTest_Valid()
        {
            //1. setup data
            List <OutContractSearchGroup> contractList = new List <OutContractSearchGroup>();

            for (int i = 1; i < 10; i++)
            {
                contractList.Add(IesContractTestDataHelper.CreateDummyContract(i));
            }

            var source = new ContractSearchResponse
            {
                MoreFlag         = "Y",
                NextContractId   = "123456789A",
                OutContractGroup = contractList.ToArray(),
            };

            //2. Exec
            var dest = MappingEngine.Map <IesContractListModel>(source);

            //3. Verification
            //Verify More parameters
            Assert.AreEqual(true, dest.HasMoreRecords);
            Assert.AreEqual(source.NextContractId, dest.NextContractId);
            //Verify response list
            Assert.AreEqual(source.OutContractGroup.Length, dest.Results.Count());
        }
Esempio n. 6
0
        public void ReadContractResponseToContractGetModelMapper_MappingTest_Valid()
        {
            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyContractDetails("0204987H");

            //2. Exec
            var dest = MappingEngine.Map <IesContractGetModel>(source);

            //3. Verification
            Assert.AreEqual(source.AccountId, dest.AccountId);
            Assert.AreEqual(source.AccountManagingOffice, dest.AccountManagingOffice);
            Assert.AreEqual(source.ApprovedAmount, dest.ApprovedAmount);
            Assert.AreEqual(source.BisAgreementId, dest.BisAgreementId);
            Assert.AreEqual(source.ContactEmail, dest.ContactEmail);
            Assert.AreEqual(source.ContactFax, dest.ContactFax);
            Assert.AreEqual(source.ContactMobile, dest.ContactMobile);
            Assert.AreEqual(source.ContactName, dest.ContactName);
            Assert.AreEqual(source.ContactPhone, dest.ContactPhone);
            Assert.AreEqual(source.ContractDescriptionLine1, dest.ContractDescriptionLine1);
            Assert.AreEqual(source.ContractDescriptionLine2, dest.ContractDescriptionLine2);
            Assert.AreEqual(source.ContractDescriptionLine3, dest.ContractDescriptionLine3);
            Assert.AreEqual(source.ContractEndDate, dest.ContractEndDate);
            Assert.AreEqual(source.ContractId, dest.ContractId);
            Assert.AreEqual(source.ContractIdDescription, dest.ContractDescription);
            Assert.AreEqual(source.ContractRound, dest.ContractRound);
            Assert.AreEqual(source.ContractStartDate, dest.ContractStartDate);
            Assert.AreEqual(source.ContractStatus, dest.ContractStatus);
            Assert.AreEqual(source.ContractType, dest.ContractType);
            Assert.AreEqual(source.CreationDate, dest.CreationDate);
            Assert.AreEqual(source.CreationTime, dest.CreationTime);
            Assert.AreEqual(source.CreationUserId, dest.CreationUserId);
            Assert.AreEqual(source.FeeForServiceFlag, dest.FeeForServiceFlag);
            Assert.AreEqual(source.FundsSpentToDate, dest.FundsSpentToDate);
            Assert.AreEqual(source.IccOfficeCode, dest.IccOfficeCode);
            Assert.AreEqual(source.InitialApprovedCost, dest.InitialApprovedCost);
            Assert.AreEqual(source.IntegrityControlNumber, dest.IntegrityControlNumber);
            Assert.AreEqual(source.MarketShare, dest.MarketShare);
            Assert.AreEqual(source.MarketSharePercentage, dest.MarketSharePercentage);
            Assert.AreEqual(source.NonContinueCode, dest.NonContinueCode);
            Assert.AreEqual(source.NovationPrefix, dest.NovationPrefix);
            Assert.AreEqual(source.OrganisationCode, dest.OrganisationCode);
            Assert.AreEqual(source.PraSecondaryAcctId, dest.SecondaryAccountId);
            Assert.AreEqual(source.ProviderDescription, dest.ProviderDescription);
            Assert.AreEqual(source.ProviderId, dest.ProviderId);
            Assert.AreEqual(source.RegionalClassificationCode, dest.RegionalClassificationCode);
            Assert.AreEqual(source.RegionArea, dest.RegionArea);
            Assert.AreEqual(source.RemoteInd, dest.RemoteInd);
            Assert.AreEqual(source.Specialisation, dest.Specialisation);
            Assert.AreEqual(source.SqlTimestamp, dest.SqlTimestamp);
            Assert.AreEqual(source.StatusDate, dest.StatusDate);
            Assert.AreEqual(source.StreamType, dest.StreamType);
            Assert.AreEqual(source.UnapprovedAmount, dest.UnapprovedAmount);
            Assert.AreEqual(source.UpdateDate, dest.UpdateDate);
            Assert.AreEqual(source.UpdateTime, dest.UpdateTime);
            Assert.AreEqual(source.UpdateUserId, dest.UpdateUserId);
            Assert.AreEqual(source.UstkFlag, dest.UstkFlag);
        }
Esempio n. 7
0
        public void OutletList_WcfThrowsFaultException_ThrowsServiceValidationException()
        {
            var exception = IesContractTestDataHelper.CreateDummyFaultException();

            //1. Setup data
            //a.request
            var request = IesContractTestDataHelper.CreateDummyOutletListModel();

            mockContractSearchWcf.Setup(m => m.OutletSearch(It.IsAny <OutletSearchRequest>())).Throws(exception);

            //2. exec
            var result = SystemUnderTest().ListOutlets(request);
        }
Esempio n. 8
0
        public void ServiceListResponseToIesServiceListModel_MappingTest_Valid()
        {
            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyServiceList("1");

            //2. Exec
            var dest = MappingEngine.Map <IesServiceListModel>(source);

            //3. Verification
            Assert.AreEqual(source.OutOutletServices.Count(), dest.Services.Count());
            Assert.AreEqual(source.MoreDataFlag == "N", dest.MoreDataFlag == false);
            Assert.AreEqual(source.LastServiceCode, dest.LastServiceCode);
        }
Esempio n. 9
0
        public void IesCountsGetToIesContractCountsGetModel_MappingTest_Valid()
        {
            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyCountsModel();

            //2. Exec
            var dest = MappingEngine.Map <IesContractCountsGetModel>(source);

            Assert.AreEqual(source.ContractTotalReferred, dest.ContractTotalReferred);
            Assert.AreEqual(source.ContractTotalServiced, dest.ContractTotalServiced);
            Assert.AreEqual(source.ContractTotalTransferred, dest.ContractTotalTransferred);
            Assert.AreEqual(source.GroupTotalReferred, dest.GroupTotalReferred);
        }
Esempio n. 10
0
        public void RegionListResponseToIesOutletRegionsGetModel_MappingTest_Valid()
        {
            //TODO: Finish writing unit test

            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyRegionListResponse("0ESJD2");

            //2. exec
            var dest = MappingEngine.Map <IesOutletRegionsListModel>(source);

            //3. verify
            Assert.AreEqual(source.ExecutionResult, dest.ExecutionResult);
            //Assert.AreEqual(source.LastRegionCode, dest.LastRegionCode);
            //Assert.AreEqual(source.LastRegionType, dest.LastRegionType);
            Assert.AreEqual(source.MoreFlag, dest.MoreFlag);
            Assert.AreEqual(source.OutOutletRegions.Count(), dest.OutletRegions.Count);
        }
Esempio n. 11
0
        public void OutletGroupToIesOutletModel_MappingTest_Valid()
        {
            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyOutlet(8);

            //2. Exec
            var dest = MappingEngine.Map <IesOutletModel>(source);

            //3. Verification
            Assert.AreEqual(source.ContractID, dest.ContractId);
            Assert.AreEqual(source.Description, dest.Description);
            Assert.AreEqual(source.EndDate, dest.OutletEndDate);
            Assert.AreEqual(source.SequenceNumber, dest.SequenceNumber);
            Assert.AreEqual(source.Services, dest.Services);
            Assert.AreEqual(source.SiteCode, dest.SiteCode);
            Assert.AreEqual(source.Status, dest.OutletStatus);
        }
Esempio n. 12
0
        public void OutletList_FailedResponse_ThrowsServiceValidationException()
        {
            //1. Setup data
            //a.request
            var request = IesContractTestDataHelper.CreateDummyOutletListModel();

            //b.response
            var response = new OutletSearchResponse();

            response.ExecutionResult = IesContractTestDataHelper.CreateDummyFailedExecutionResult();

            mockContractSearchWcf.Setup(m => m.OutletSearch(It.IsAny <OutletSearchRequest>())).Returns(response);

            //2. exec
            var result = SystemUnderTest().ListOutlets(request);

            //3. Verification
        }
Esempio n. 13
0
        public void ContractGroupToIesContractModel_MappingTest_Valid()
        {
            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyContract(8);

            //2. Exec
            var dest = MappingEngine.Map <IesContractModel>(source);

            //3. Verification
            Assert.AreEqual(source.AccountManagingOffice, dest.AccountManagingOffice);
            Assert.AreEqual(source.ContractEndDate, dest.ContractEndDate);
            Assert.AreEqual(source.ContractId, dest.ContractId);
            Assert.AreEqual(source.ContractIdDescription, dest.ContractDescription);
            Assert.AreEqual(source.ContractStatus, dest.ContractStatus);
            Assert.AreEqual(source.ContractType, dest.ContractType);
            Assert.AreEqual(source.OrganisationCode, dest.OrganisationCode);
            Assert.AreEqual(source.RegionArea, dest.RegionArea);
            Assert.AreEqual(source.Specialisation, dest.Specialisation);
        }
Esempio n. 14
0
        public void OutletUpdateSSC_FailedResponse_ThrowsServiceValidationException()
        {
            //1. Setup data
            //a.request

            IesOutletUpdateSSCRequestModel request = new IesOutletUpdateSSCRequestModel
            {
                CheckRelatedOutletFlag = "N",
                ContactName            = "TBA",
                ContractId             = "0205881K",
                EmailAddress           = null,
                EndDate   = new DateTime(2015, 6, 30),
                FaxNumber = null,
                IntegrityControlNumber = 118,
                MobileNumber           = null,
                PhoneNumber            = "0123456789",
                ProviderText           = "abc",
                RelatedOutlets         = null,
                SequenceNumber         = 1,
                StartDate                    = new DateTime(2009, 4, 2),
                SupervisingOffice            = "QLPU",
                SuspendClaimsFromDate        = DateTime.MinValue,
                SuspendEPFFromDate           = DateTime.MinValue,
                SuspendNewCaseFromDate       = DateTime.MinValue,
                SuspendRefsFromDate          = DateTime.MinValue,
                SuspendRelatedEntityFromDate = DateTime.MinValue,
                SuspendReturnFromDate        = DateTime.MinValue,
                SuspendTransportFromDate     = DateTime.MinValue
            };

            //b.response
            var response = new OutletUpdateSSCResponse();

            response.ExecutionResult = IesContractTestDataHelper.CreateDummyFailedExecutionResult();

            mockOutletUpdateWcf.Setup(m => m.UpdateOutletSSC(It.IsAny <OutletUpdateSSCRequest>())).Returns(response);

            //2. exec
            var result = SystemUnderTest().UpdateOutletSSC(request);

            //3. Verification
        }
Esempio n. 15
0
        public void ContractListModelToContractSearchRequestMapper_MappingTest_Valid()
        {
            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyContractListModel();

            //2. Exec
            var dest = MappingEngine.Map <ContractSearchRequest>(source);

            //3. Verification
            Assert.AreEqual(source.AccountManagingOffice, dest.AccountManagingOffice);
            Assert.AreEqual(source.ActivityId, dest.ActivityId);
            Assert.AreEqual(source.ContractEndDateFrom, dest.ContractEndDateFrom);
            Assert.AreEqual(source.ContractEndDateTo, dest.ContractEndDateTo);
            Assert.AreEqual(source.ContractRound, dest.ContractRound);
            Assert.AreEqual(source.ContractStartDateFrom, dest.ContractStartDateFrom);
            Assert.AreEqual(source.ContractStartDateTo, dest.ContractStartDateTo);
            Assert.AreEqual(source.ContractStatus, dest.ContractStatus);
            Assert.AreEqual(source.ContractType, dest.ContractType);
            Assert.AreEqual(source.OrganisationCode, dest.Organisation);
            Assert.AreEqual(source.ProviderId, dest.ProviderId);
        }
Esempio n. 16
0
        public void IesCountsGet_Valid()
        {
            //1. Setup data
            //a.request
            string contractId = "0204342H";

            //b.response
            var response = IesContractTestDataHelper.CreateDummyCountsModel();

            mockContractGetWcf.Setup(m => m.GetCounts(It.IsAny <GetCountsRequest>())).Returns(response);

            //2. exec
            var result = SystemUnderTest().GetCounts(contractId);

            //3. Verification
            //Verify More parameters
            Assert.IsTrue(result.ContractTotalReferred.Equals(response.ContractTotalReferred));

            //Verify behaviour
            mockContractGetWcf.Verify(m => m.GetCounts(It.Is <GetCountsRequest>(r => r.ContractId == contractId)), Times.Once());
        }
Esempio n. 17
0
        public void OutOutletServiceToIesServiceModel_MappingTest_Valid()
        {
            //1. setup data
            var source = IesContractTestDataHelper.CreateDummyService("1");

            //2. Exec
            var dest = MappingEngine.Map <IesServiceModel>(source);

            //3. Verification
            Assert.AreEqual(source.Code, dest.Code);
            Assert.AreEqual(source.CreatedBy, dest.CreatedBy);
            Assert.AreEqual(source.CreatedDate, dest.CreatedDate);
            Assert.AreEqual(source.CreatedTime, dest.CreatedTime);
            Assert.AreEqual(source.EndDate, dest.EndDate);
            Assert.AreEqual(source.IntegrityControlNumber, dest.IntegrityControlNumber);
            Assert.AreEqual(source.ServiceSequenceNumber, dest.ServiceSequenceNumber);
            Assert.AreEqual(source.StartDate, dest.StartDate);
            Assert.AreEqual(source.Status, dest.Status);
            Assert.AreEqual(source.UpdatedBy, dest.UpdatedBy);
            Assert.AreEqual(source.UpdatedDate, dest.UpdatedDate);
            Assert.AreEqual(source.UpdatedTime, dest.UpdatedTime);
        }
Esempio n. 18
0
        public void ContractGet_Valid()
        {
            //1. Setup data
            //a.request
            string contractId = "0204342H";
            // var request = new ReadContractRequest { ContractId = contractId };
            //b.response

            var response = IesContractTestDataHelper.CreateDummyContractDetails(contractId);

            mockContractGetWcf.Setup(m => m.ReadContract(It.IsAny <ReadContractRequest>())).Returns(response);

            //2. exec
            var result = SystemUnderTest().GetContract(contractId);

            //3. Verification
            //Verify More parameters
            Assert.IsTrue(result.ContractId.Equals(contractId));

            //Verify behaviour
            mockContractGetWcf.Verify(m => m.ReadContract(It.Is <ReadContractRequest>(r => r.ContractId == contractId)), Times.Once());
        }
Esempio n. 19
0
        public void SiteGet_Valid()
        {
            //1. setup data
            //a. request

            string siteCode = "0F2@";

            mockUserService.Setup(x => x.OrganisationCode).Returns("1");

            //b. response
            var response = IesContractTestDataHelper.CreateDummySiteDetails(siteCode);

            mockSiteGetWcf.Setup(m => m.GetSiteDetails(It.IsAny <SiteGetRequest>())).Returns(response);

            //2. exec
            var result = SystemUnderTest().GetSite(siteCode);

            //3. verify
            Assert.IsTrue(result.SiteCode.Equals(siteCode));

            //b. verify behavior
            mockSiteGetWcf.Verify(m => m.GetSiteDetails(It.Is <SiteGetRequest>(r => r.SiteCode == siteCode)), Times.Once());
        }
Esempio n. 20
0
        public void GetServiceList_Valid()
        {
            //1. Setup data
            //a.request
            const string contractId     = "0204342H";
            const int    sequenceNumber = 1;

            //b.response
            var response = IesContractTestDataHelper.CreateDummyServiceListModel();

            mockOutletUpdateWcf.Setup(m => m.ListService(It.IsAny <ServiceListRequest>())).Returns(response);

            //2. exec
            var result = SystemUnderTest().ListOutletServices(contractId, sequenceNumber);

            //3. Verification
            //Verify More parameters
            Assert.IsTrue(result.LastServiceCode.Equals(response.LastServiceCode));
            Assert.IsTrue(result.LastServiceSeqNum.Equals(response.LastServiceSeqNum));
            Assert.IsTrue(result.MoreDataFlag);
            Assert.IsTrue(result.Services.ElementAt(0).Code.Equals(response.OutOutletServices.ElementAt(0).Code));
            Assert.IsTrue(result.Services.ElementAt(0).CreatedBy.Equals(response.OutOutletServices.ElementAt(0).CreatedBy));
            Assert.IsTrue(result.Services.ElementAt(0).CreatedDate.Equals(response.OutOutletServices.ElementAt(0).CreatedDate));
            Assert.IsTrue(result.Services.ElementAt(0).CreatedTime.Equals(response.OutOutletServices.ElementAt(0).CreatedTime));
            Assert.IsTrue(result.Services.ElementAt(0).EndDate.Equals(response.OutOutletServices.ElementAt(0).EndDate));
            Assert.IsTrue(result.Services.ElementAt(0).IntegrityControlNumber.Equals(response.OutOutletServices.ElementAt(0).IntegrityControlNumber));
            Assert.IsTrue(result.Services.ElementAt(0).ServiceSequenceNumber.Equals(response.OutOutletServices.ElementAt(0).ServiceSequenceNumber));
            Assert.IsTrue(result.Services.ElementAt(0).StartDate.Equals(response.OutOutletServices.ElementAt(0).StartDate));
            Assert.IsTrue(result.Services.ElementAt(0).Status.Equals(response.OutOutletServices.ElementAt(0).Status));
            Assert.IsTrue(result.Services.ElementAt(0).UpdatedBy.Equals(response.OutOutletServices.ElementAt(0).UpdatedBy));
            Assert.IsTrue(result.Services.ElementAt(0).UpdatedDate.Equals(response.OutOutletServices.ElementAt(0).UpdatedDate));
            Assert.IsTrue(result.Services.ElementAt(0).UpdatedTime.Equals(response.OutOutletServices.ElementAt(0).UpdatedTime));

            //Verify behaviour
            mockOutletUpdateWcf.Verify(m => m.ListService(It.Is <ServiceListRequest>(r => r.ContractId == contractId)), Times.Once());
            mockOutletUpdateWcf.Verify(m => m.ListService(It.Is <ServiceListRequest>(r => r.SequenceNumber == sequenceNumber)), Times.Once());
        }
Esempio n. 21
0
        public void ReadOutletCount_Valid()
        {
            //1. Setup data
            //a.request
            const string contractId     = "0204342H";
            const int    sequenceNumber = 1;

            //b.response
            var response = IesContractTestDataHelper.CreateDummyOutletCountsModel();

            mockOutletUpdateWcf.Setup(m => m.ReadOutletCount(It.IsAny <ReadOutletCountRequest>())).Returns(response);

            //2. exec
            var result = SystemUnderTest().GetOutletCounts(contractId, sequenceNumber);

            //3. Verification
            //Verify More parameters
            Assert.IsTrue(result.OutletTotalReferred.Equals(response.OutletTotalReferred));
            Assert.IsTrue(result.OutletTotalServiced.Equals(response.OutletTotalServiced));
            Assert.IsTrue(result.OutletTotalTransferred.Equals(response.OutletTotalTransferred));

            //Verify behaviour
            mockOutletUpdateWcf.Verify(m => m.ReadOutletCount(It.Is <ReadOutletCountRequest>(r => r.ContractId == contractId)), Times.Once());
        }