public void SetCopiedFrom_Success()
        {
            // Assign 
            var quote = new Quote();
            var submission = new globalVM::Validus.Models.Submission();

            // Act 
            SubmissionModuleHelpers.SetCopiedFrom(quote, submission);

            // Assert
        }
        public void UpdateSubscribeRecord_Success()
        {
            // Assign 
            var quote = new Quote {FacilityRef = "Facility ref"};
            var submission = new globalVM::Validus.Models.Submission();

            // Act 
            var actualUpdatePolicyResponse = SubmissionModuleHelpers.UpdateSubscribeRecord(quote, submission, _logHandler, _mockSubscribeService);

            // Assert
            Assert.IsNotNull(actualUpdatePolicyResponse);
        }
        public void CreateBasicSubmission_MissingValues_ReturnError()
        {
            // Assign
            var submission = new globalVM::Validus.Models.Submission
                {
                    CreatedBy = "InitialSetup",
                    CreatedOn = DateTime.Now,
                    ModifiedBy = "InitialSetup",
                    ModifiedOn = DateTime.Now,

                    InsuredName = "- N/A",
                    BrokerCode = "1111",
                    BrokerPseudonym = "AAA",
                    BrokerSequenceId = 822,
                    InsuredId = 182396,
                    Brokerage = 1,
                    BrokerContact = "ALLAN MURRAY",
                    UnderwriterCode = "AED",
                    UnderwriterContactCode = "JAC",
                    QuotingOfficeId = "LON",
                    Leader = "AG",
                    Domicile = "AD",
                    Title = "Unit Test Submission",
                    MarketWordingSettings = new List<MarketWordingSetting>(),
                    TermsNConditionWordingSettings = new List<TermsNConditionWordingSetting>(),
                    SubjectToClauseWordingSettings = new List<SubjectToClauseWordingSetting>(),
                    CustomMarketWordingSettings = new List<MarketWordingSetting>(),
                    CustomSubjectToClauseWordingSettings = new List<SubjectToClauseWordingSetting>(),
                    CustomTermsNConditionWordingSettings = new List<TermsNConditionWordingSetting>(),
                    Options = new List<Option>
                        {
                            new Option
                                {
                                    Id = 1,
                                    OptionVersions = new List<OptionVersion>
                                        {
                                            new OptionVersion
                                                {
                                                    OptionId = 0,
                                                    VersionNumber = 0,
                                                    Comments = "OptionVersion Comments",
                                                    Quotes = new List<Quote>
                                                        {
                                                            new Quote
                                                                {
                                                                    COBId = "BA",
                                                                    MOA = "FA",
                                                                    OriginatingOffice = new Office {Id = "DUB"},
                                                                    InceptionDate = DateTime.Now,
                                                                    QuoteExpiryDate = DateTime.Now,
                                                                    AccountYear = 2013,
                                                                    Currency = "USD",
                                                                    LimitCCY = "USD",
                                                                    ExcessCCY = "USD",
                                                                    CorrelationToken = Guid.NewGuid(),
                                                                    IsSubscribeMaster = true,
                                                                    PolicyType = "NONMARINE",
                                                                    EntryStatus = "PARTIAL",
                                                                    SubmissionStatus = "SUBMITTED"
                                                                }
                                                        }
                                                }
                                        }
                                }
                        }
                };

            // Act
            List<String> subscribeErrors;
            var actualSubmission = _submissionModule.CreateSubmission(submission, out subscribeErrors);

            // Assert

        }
        public void SynchroniseSubmission_Success()
        {
            // Assign
            var submission = new globalVM::Validus.Models.Submission();
            var policyContract = new PolicyContract { InsdNm = "Insured Name...", BkrSeqId = 1, NonLonBkr = "AON", Uwr = "UC", Brokerage = 3, AccYr = "1976", ExpyDt = "19761229", IncpDt = "19761229", SettDueDt = "19761229" };

            // Act 
            SubmissionModuleHelpers.SynchroniseSubmission(submission, policyContract);

            // Assert
            Assert.AreEqual(submission.InsuredName, policyContract.InsdNm);
        }
        public void QuoteValuesMatchSubscribePolicy_False()
        {
            // Assign 
            var quote = new Quote();
            var submission = new globalVM::Validus.Models.Submission();
            var policyContract = new PolicyContract { InsdNm = "Insured Name...", BkrSeqId = 1, NonLonBkr = "AON", Uwr = "UC", Brokerage = 3, AccYr = "1976", ExpyDt = "19761229", IncpDt = "19761229", SettDueDt = "19761229" };

            // Act 
            var actualResult = SubmissionModuleHelpers.QuoteValuesMatchSubscribePolicy(policyContract, quote, submission);

            // Assert
            Assert.IsFalse(actualResult);
        }
        public void CreateSubscribeRecord_Success()
        {
            // Assign 
            var quote = new Quote();
            var submission = new globalVM::Validus.Models.Submission();
            var expectedPolId = "BAN165118A13";

            // Act 
            var actualResponse = SubmissionModuleHelpers.CreateSubscribeRecord(quote, submission, _logHandler, _mockSubscribeService);

            // Assert
            Assert.IsNotNull(actualResponse);
            Assert.AreEqual(actualResponse.objInfoCollection.PolId, expectedPolId);
        }
        public static void CreateComplexCargoSubmission()
        {
            _complexCargoSubmission = new globalVM::Validus.Models.Submission
            {
                CreatedBy = "InitialSetup",
                CreatedOn = DateTime.Now,
                ModifiedBy = "InitialSetup",
                ModifiedOn = DateTime.Now,

                InsuredName = "- N/A",
                BrokerCode = "1111",
                BrokerPseudonym = "AAA",
                BrokerSequenceId = 822,
                InsuredId = 182396,
                Brokerage = 1,
                BrokerContact = "ALLAN MURRAY",
               
                UnderwriterCode = "AED",
                UnderwriterContactCode = "JAC",
                QuotingOfficeId = "LON",
                Leader = "AG",
                Domicile = "AD",
                Title = "Unit Test Submission",
                SubmissionTypeId = "EN",
                MarketWordingSettings = new List<MarketWordingSetting>(),
                TermsNConditionWordingSettings = new List<TermsNConditionWordingSetting>(),
                SubjectToClauseWordingSettings = new List<SubjectToClauseWordingSetting>(),
                CustomMarketWordingSettings = new List<MarketWordingSetting>(),
                CustomSubjectToClauseWordingSettings = new List<SubjectToClauseWordingSetting>(),
                CustomTermsNConditionWordingSettings = new List<TermsNConditionWordingSetting>(),
                Options = new List<Option>{
                        new Option 
                        { 
                            Id = 1, 
                            Title = "Option 1 - Unit Test Submission",
                            CreatedBy = "InitialSetup",
                            CreatedOn = DateTime.Now,
                            ModifiedBy = "InitialSetup",
                            ModifiedOn = DateTime.Now,
                            OptionVersions = new List<OptionVersion>{
                                new OptionVersionCA { 
                                    OptionId = 0, 
                                    VersionNumber = 0, 
                                    Comments = "OptionVersion Comments", 
                                    Title = "OptionVersion 1 - Unit Test Submission", 
                                    CreatedBy = "InitialSetup",
                                    CreatedOn = DateTime.Now,
                                    ModifiedBy = "InitialSetup",
                                    ModifiedOn = DateTime.Now,
                                    Quotes = new List<Quote>
                                        {
                                            new QuoteCA
                                            { 
                                                COBId = "AD", 
                                                MOA = "FA", 
                                                InceptionDate = DateTime.Now, 
                                                ExpiryDate = DateTime.Now.AddMonths(12), 
                                                QuoteExpiryDate = DateTime.Now, 
                                                AccountYear = 2013, 
                                                Currency = "USD", 
                                                LimitCCY = "USD", 
                                                ExcessCCY = "USD", 
                                                CorrelationToken = Guid.NewGuid(), 
                                                IsSubscribeMaster = true, 
                                                PolicyType = "NONMARINE", 
                                                EntryStatus = "PARTIAL", 
                                                SubmissionStatus = "SUBMITTED", 
                                                TechnicalPricingBindStatus = "PRE", 
                                                TechnicalPricingPremiumPctgAmt = "AMT", 
                                                TechnicalPricingMethod = "UW" ,
                                                CreatedBy = "InitialSetup",
                                                CreatedOn = DateTime.Now,
                                                ModifiedBy = "InitialSetup",
                                                ModifiedOn = DateTime.Now,
                                                OriginatingOfficeId = "LON"
                                            },
                                            new QuoteCA 
                                            { 
                                                COBId = "AD", 
                                                MOA = "FA", 
                                                InceptionDate = DateTime.Now, 
                                                ExpiryDate = DateTime.Now.AddMonths(12), 
                                                QuoteExpiryDate = DateTime.Now, 
                                                AccountYear = 2013, 
                                                Currency = "USD", 
                                                LimitCCY = "USD", 
                                                ExcessCCY = "USD", 
                                                CorrelationToken = Guid.NewGuid(), 
                                                IsSubscribeMaster = true, 
                                                PolicyType = "NONMARINE", 
                                                EntryStatus = "PARTIAL", 
                                                SubmissionStatus = "SUBMITTED", 
                                                TechnicalPricingBindStatus = "PRE", 
                                                TechnicalPricingPremiumPctgAmt = "AMT", 
                                                TechnicalPricingMethod = "UW" ,
                                                CreatedBy = "InitialSetup",
                                                CreatedOn = DateTime.Now,
                                                ModifiedBy = "InitialSetup",
                                                ModifiedOn = DateTime.Now,
                                                OriginatingOfficeId = "LON"
                                            }
                                        }
                                }}
                        }, 
                        new Option 
                        { 
                            Id = 2, 
                            Title = "Option 2 - Unit Test Submission",
                            CreatedBy = "InitialSetup",
                            CreatedOn = DateTime.Now,
                            ModifiedBy = "InitialSetup",
                            ModifiedOn = DateTime.Now,
                            OptionVersions = new List<OptionVersion>{
                                new OptionVersionCA { 
                                    OptionId = 0, 
                                    VersionNumber = 0, 
                                    Comments = "OptionVersion Comments", 
                                    Title = "OptionVersion 2 - Unit Test Submission", 
                                    CreatedBy = "InitialSetup",
                                    CreatedOn = DateTime.Now,
                                    ModifiedBy = "InitialSetup",
                                    ModifiedOn = DateTime.Now,
                                    Quotes = new List<Quote>
                                        {
                                            new QuoteCA
                                            { 
                                                COBId = "AD", 
                                                MOA = "FA", 
                                                InceptionDate = DateTime.Now, 
                                                ExpiryDate = DateTime.Now.AddMonths(12), 
                                                QuoteExpiryDate = DateTime.Now, 
                                                AccountYear = 2013, 
                                                Currency = "USD", 
                                                LimitCCY = "USD", 
                                                ExcessCCY = "USD", 
                                                CorrelationToken = Guid.NewGuid(), 
                                                IsSubscribeMaster = true, 
                                                PolicyType = "NONMARINE", 
                                                EntryStatus = "PARTIAL", 
                                                SubmissionStatus = "SUBMITTED", 
                                                TechnicalPricingBindStatus = "PRE", 
                                                TechnicalPricingPremiumPctgAmt = "AMT", 
                                                TechnicalPricingMethod = "UW" ,
                                                CreatedBy = "InitialSetup",
                                                CreatedOn = DateTime.Now,
                                                ModifiedBy = "InitialSetup",
                                                ModifiedOn = DateTime.Now,
                                                OriginatingOfficeId = "LON",
                                            },
                                            new QuoteCA
                                            { 
                                                COBId = "AD", 
                                                MOA = "FA", 
                                                InceptionDate = DateTime.Now, 
                                                ExpiryDate = DateTime.Now.AddMonths(12), 
                                                QuoteExpiryDate = DateTime.Now, 
                                                AccountYear = 2013, 
                                                Currency = "USD", 
                                                LimitCCY = "USD", 
                                                ExcessCCY = "USD", 
                                                CorrelationToken = Guid.NewGuid(), 
                                                IsSubscribeMaster = true, 
                                                PolicyType = "NONMARINE", 
                                                EntryStatus = "PARTIAL", 
                                                SubmissionStatus = "SUBMITTED", 
                                                TechnicalPricingBindStatus = "PRE", 
                                                TechnicalPricingPremiumPctgAmt = "AMT", 
                                                TechnicalPricingMethod = "UW" ,
                                                CreatedBy = "InitialSetup",
                                                CreatedOn = DateTime.Now,
                                                ModifiedBy = "InitialSetup",
                                                ModifiedOn = DateTime.Now,
                                                OriginatingOfficeId = "LON",
                                            },
                                            new QuoteCA 
                                            { 
                                                COBId = "AD", 
                                                MOA = "FA", 
                                                InceptionDate = DateTime.Now, 
                                                ExpiryDate = DateTime.Now.AddMonths(12), 
                                                QuoteExpiryDate = DateTime.Now, 
                                                AccountYear = 2013, 
                                                Currency = "USD", 
                                                LimitCCY = "USD", 
                                                ExcessCCY = "USD", 
                                                CorrelationToken = Guid.NewGuid(), 
                                                IsSubscribeMaster = true, 
                                                PolicyType = "NONMARINE", 
                                                EntryStatus = "PARTIAL", 
                                                SubmissionStatus = "SUBMITTED", 
                                                TechnicalPricingBindStatus = "PRE", 
                                                TechnicalPricingPremiumPctgAmt = "AMT", 
                                                TechnicalPricingMethod = "UW" ,
                                                CreatedBy = "InitialSetup",
                                                CreatedOn = DateTime.Now,
                                                ModifiedBy = "InitialSetup",
                                                ModifiedOn = DateTime.Now,
                                                OriginatingOfficeId = "LON",
                                            }

                                        }
                                }
                            }
                        }
                }
            };
        }