コード例 #1
0
 public HowToPlayComponent(Game game, InputManager input)
     : base(game)
 {
     _game = game;
     _input = input;
     _coverage = new Coverage(Color.Black);
     LoadContent(_game.Content);
 }
コード例 #2
0
ファイル: ReportGenerator.cs プロジェクト: SteGriff/NCover
		private void PopulateNamespaces(Report report, Coverage coverage)
		{
			foreach(CoveragePoint point in coverage.CoveragePoints)
			{
				if(!string.IsNullOrEmpty(point.Namespace) && !report.Namespaces.Contains(point.Namespace))
				{
					report.Namespaces.Add(new Namespace() { Name = point.Namespace });
				}
			}
		}
コード例 #3
0
ファイル: ReportGenerator.cs プロジェクト: SteGriff/NCover
		private void PopulateFile(ReportFile file, Namespace ns, Coverage coverage)
		{
			foreach(CoveragePoint point in coverage.CoveragePoints)
			{
				if(point.Namespace == ns.Name && point.Filename == file.Filename)
				{
					file.Points.Add(point);
				}
			}
		}
コード例 #4
0
ファイル: BullseyeToEmma.cs プロジェクト: gbruce/cover2emma
        private static emma.coverage[] CreateCoverage(bullseye.src src, emma.@class[] classes)
        {
            Coverage cov = new Coverage();
            foreach (var cls in classes)
            {
                var covs =
                    Utils.ParseCoverages((from item in cls.Items where item is emma.coverage select (emma.coverage) item).ToArray());
                cov.Add(covs.ClassCovered, covs.ClassTotal);
            }

            return Utils.CreateCoverage(cov.Covered.ToString(), cov.Total.ToString(), src.fn_cov, src.fn_total, src.cd_cov,
                                        src.cd_total, "0", "0");
        }
コード例 #5
0
 public ResultEntry(TrackData track, double score, DateTime matchedAt, Coverage coverage)
 {
     Coverage           = coverage;
     Track              = track;
     QueryMatchStartsAt = Coverage.QueryMatchStartsAt;
     TrackCoverageWithPermittedGapsLength = Coverage.TrackCoverageWithPermittedGapsLength;
     DiscreteTrackCoverageLength          = Coverage.TrackDiscreteCoverageLength;
     TrackMatchStartsAt = Coverage.TrackMatchStartsAt;
     Confidence         = Coverage.Confidence;
     Score         = score;
     TrackStartsAt = Coverage.TrackStartsAt;
     QueryLength   = Coverage.QueryLength;
     MatchedAt     = matchedAt;
 }
コード例 #6
0
        // GET: Coverages/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Coverage coverage = await db.Coverages.FindAsync(id);

            if (coverage == null)
            {
                return(HttpNotFound());
            }
            return(View(coverage));
        }
コード例 #7
0
 public ResultEntry(TrackData track, double confidence, double score, DateTime matchedAt, Coverage coverage)
     : this(track,
            confidence,
            score,
            matchedAt,
            coverage.QueryLength,
            coverage.QueryMatchStartsAt,
            coverage.CoverageWithPermittedGapsLength,
            coverage.DiscreteCoverageLength,
            coverage.TrackMatchStartsAt,
            coverage.TrackStartsAt)
 {
     Coverage = coverage;
 }
コード例 #8
0
        private void button3_Click(object sender, EventArgs e)
        {
            string   id    = Guid.NewGuid().ToString();
            Coverage t     = new Coverage(id, CustomerID, nameTxt.Text, typeCbx.Text, catCbx.Text, noTxt.Text, DateTime.Now.ToString("dd-MM-yyyy H:m:s"), "false", Helper.CompanyID, Convert.ToDateTime(dateTxt.Text).ToString("dd-MM-yyyy"));
            string   saves = MySQL.Insert(t);

            if (saves != "")
            {
                Queries q = new Queries(Guid.NewGuid().ToString(), Helper.UserName, Helper.CleanString(saves), "false", DateTime.Now.ToString("dd-MM-yyyy H:m:s"), Helper.CompanyID);
                MySQL.Insert(q);
                MessageBox.Show("Information Saved");
                this.DialogResult = DialogResult.OK;
                this.Dispose();
            }
        }
        public void Setup()
        {
            _coverageTrue = new Coverage
            {
                CoverageName = "SS",
                PolicyId     = 89
            };

            _coverageFalse = new Coverage
            {
                PolicyId = 5
            };

            _coverageValidator = new CoverageValidator();
        }
コード例 #10
0
        public async Task GivenUniqueInformation_WhenMemberMatchSent_ThenPatientFound(string city, string name, string date, string type, string subPlan, string expectedId)
        {
            var searchPatient = new Patient();

            _fixture.SetPatient(searchPatient, city, name, birthDate: date);
            var searchCoverage = new Coverage();

            _fixture.SetCoverage(searchCoverage, searchPatient, type, subPlan);
            var outParameters = await _client.MemberMatch(searchPatient, searchCoverage);

            var returnPatient = outParameters.Get("MemberPatient").First().Resource as Patient;
            var identifeir    = returnPatient.Identifier.Where(x => x.Type.Coding.Where(code => code.Code == "UMB").Any()).First().Value;

            Assert.Equal(expectedId, identifeir);
        }
コード例 #11
0
        public override bool Execute()
        {
            try
            {
                _coverage = new Coverage(_path, Guid.NewGuid().ToString());
                _coverage.PrepareModules();
            }
            catch (Exception ex)
            {
                Log.LogErrorFromException(ex);
                return(false);
            }

            return(true);
        }
コード例 #12
0
ファイル: ReportGenerator.cs プロジェクト: SteGriff/NCover
		private void PopulateNamespace(Namespace ns, Coverage coverage)
		{
			foreach(CoveragePoint point in coverage.CoveragePoints)
			{
				if(point.Namespace == ns.Name)
				{
					if(!ns.Files.Contains(point.Filename))
					{
                        ReportFile file = new ReportFile() { Filename = point.Filename };
						ns.Files.Add(file);
						PopulateFile(file, ns, coverage);
					}
				}
			}
		}
コード例 #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     btnNext.Attributes.Add("onClick", "return valSubmit();");
     if (Session["UserID"] != null)
     {
         if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null))
         {
             Coverage myCoverage = (Coverage)Session["Coverage"];
             if (myCoverage.isWaiving("Dental"))
             {
                 tdDental.InnerHtml = myCoverage.getWhoIsWaiving("Dental");
             }
         }
     }
 }
コード例 #14
0
        /// <summary>
        /// Call this to continue recording on the current coverage recording session, after having paused the recording.
        /// </summary>
        public static void UnpauseRecording()
        {
            CoverageAnalytics.instance.CurrentCoverageEvent.useAPI_UnpauseRec = true;

            bool isRunning = CoverageRunData.instance.isRunning;

            if (isRunning)
            {
                if (CoverageRunData.instance.isRecording && CoverageRunData.instance.isRecordingPaused)
                {
                    Coverage.ResetAll();

                    CoverageRunData.instance.UnpauseRecording();
                }
            }
        }
コード例 #15
0
        public override bool Execute()
        {
            try
            {
                var excludeRules = Exclude?.Split(',');
                Coverage = new Coverage(Path, Guid.NewGuid().ToString(), excludeRules);
                Coverage.PrepareModules();
            }
            catch (Exception ex)
            {
                Log.LogErrorFromException(ex);
                return(false);
            }

            return(true);
        }
コード例 #16
0
        protected override string GetText(IFeature feature)
        {
            var loc = (INetworkLocation)feature;

            //return locationname..segment name or value of the feature
            if (LabelColumn == "Branch")
            {
                return(loc.Branch.Name);
            }
            if (LabelColumn == "Offset")
            {
                return(loc.Offset.ToString());
            }

            return(Coverage.Evaluate(loc).ToString());
        }
コード例 #17
0
        // GET: Coverage/Edit/5
        /// <summary>
        /// Edit a coverage.
        /// </summary>
        /// <param name="id">Coverage id.</param>
        /// <returns>Coverage view.</returns>
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Coverage coverage = db.Coverages.Find(id);

            if (coverage == null)
            {
                return(HttpNotFound());
            }

            return(View(coverage));
        }
コード例 #18
0
        public static CoverageResult GetCoverageResult(string filePath)
        {
            SetTestContainer();
            using var result = new FileStream(filePath, FileMode.Open);
            var logger = new Mock <ILogger>();

            logger.Setup(l => l.LogVerbose(It.IsAny <string>())).Callback((string message) =>
            {
                Assert.DoesNotContain("not found for module: ", message);
            });
            _processWideContainer.GetRequiredService <IInstrumentationHelper>().SetLogger(logger.Object);
            CoveragePrepareResult coveragePrepareResultLoaded = CoveragePrepareResult.Deserialize(result);
            Coverage coverage = new Coverage(coveragePrepareResultLoaded, logger.Object, _processWideContainer.GetService <IInstrumentationHelper>(), new FileSystem(), new SourceRootTranslator(new Mock <ILogger>().Object, new FileSystem()));

            return(coverage.GetCoverageResult());
        }
コード例 #19
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            if (Session["UserID"] != null)
            {
                if ((Session["EmployeeData"] != null) && (Session["Coverage"] != null))
                {
                    bool isSpouseCovered   = false;
                    bool isChildrenCovered = false;

                    Coverage      myCoverage = (Coverage)Session["Coverage"];
                    employeeData  myData     = (employeeData)Session["EmployeeData"];
                    DeclineReason myReason   = saveReasons();

                    if (Session["ReasonForDeclineDisability"] != null)
                    {
                        Session.Add("ReasonForDeclineDisability", myReason);
                    }
                    else
                    {
                        Session["ReasonForDeclineDisability"] = myReason;
                    }
                    if (!myData.IsSingle)
                    {
                        isSpouseCovered = myCoverage.isSpouseCovered();
                    }
                    if (myData.IsChildren)
                    {
                        isChildrenCovered = myCoverage.isChildCovered();
                    }
                    if (isSpouseCovered || isChildrenCovered)
                    {
                        Response.Redirect("DependentData.aspx", false);
                    }
                    else
                    {
                        if (myData.WaiveAll || myCoverage.IsWaiveAll)
                        {
                            Response.Redirect("Processing.aspx", false);
                        }
                        else
                        {
                            Response.Redirect("OtherCoverage.aspx", false);
                        }
                    }
                }
            }
        }
コード例 #20
0
        public void FindCoverageUnitTests()
        {
            var finder = new CoverageRepository();

            Coverage coverage1 = finder.Find("1");
            Coverage coverage2 = finder.Find("2");
            Coverage coverage3 = finder.Find("3");

            Assert.True(coverage1 != null);
            Assert.True(coverage1.Id == "1");

            Assert.True(coverage2 != null);
            Assert.True(coverage2.Id == "2");

            Assert.True(coverage3 != null);
            Assert.True(coverage3.Id == "3");
        }
コード例 #21
0
ファイル: ReportGenerator.cs プロジェクト: SteGriff/NCover
        /// <summary>
        /// Generates the report.
        /// </summary>
        /// <param name="coverage">The coverage.</param>
        /// <returns></returns>
		public Report GenerateReport(Coverage coverage)
		{
			Report report = new Report();
			report.SharpCoverVersion = this.GetType().Assembly.GetName().Version.ToString();
			report.ReportDate = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
			report.ReportName = coverage.Settings.ReportName;
			report.SourceDir = coverage.Settings.BaseDir;
			
			PopulateNamespaces(report, coverage);

			foreach(Namespace ns in report.Namespaces)
			{
				PopulateNamespace(ns, coverage);
			}

			return report;
		}
        public void OnInitialise(CoverageSettings settings)
        {
            m_CoverageSettings = settings;

            if (!m_OutputPerTest && m_CoverageSettings.resetCoverageData)
            {
                Coverage.ResetAll();
            }

            m_ReporterFilter.SetupFiltering();

            if (m_Writer == null)
            {
                m_Writer = new OpenCoverResultWriter(m_CoverageSettings);
            }
            m_Writer.SetupCoveragePaths();
        }
コード例 #23
0
ファイル: SharpCoverAction.cs プロジェクト: SteGriff/NCover
		private void SaveCoverage(CoveragePoint[] points)
		{
			Coverage coverage = new Coverage(this.Settings, points);

            string fileName = this.Settings.ExpectedFilename;

            // create directory before writing file
            if (!Directory.Exists(Path.GetDirectoryName(fileName)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(fileName));
            }

            using (FileStream outputstream = new FileStream(fileName, FileMode.Create))
            {
                Coverage.SaveCoverage(outputstream, coverage);
            }
		}
コード例 #24
0
        private void OnDeserialized(StreamingContext context = default(StreamingContext))
        {
            Coverage = Coverage ?? new ObservableCollection <LandCoverItem>();
            if (Coverage.Count == 0 || Coverage[0].Mapping == null)
            {
                Coverage.Clear();
                foreach (var item in LandCoverTableService.GetTable("ESACCI LCCS"))
                {
                    Coverage.Add(item.Clone());
                }
            }

            if (BufferDistance == 0)
            {
                BufferDistance = 300;
            }
        }
コード例 #25
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(typeCbx.Text))
            {
                typeCbx.BackColor = Color.Red;
                MessageBox.Show(" Please select the type of Insurance");
                return;
            }
            string   ID = Guid.NewGuid().ToString();
            Coverage _e = new Coverage(ID, CustomerID, nameTxt.Text, typeCbx.Text, catCbx.Text, noTxt.Text, DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss"), "false", Helper.CompanyID, Convert.ToDateTime(dateTxt.Text).ToString("dd-MM-yyyy"));

            MySQL.Insert(_e);
            GenericCollection.coverage.Add(_e);
            MessageBox.Show("Information Saved");
            this.DialogResult = DialogResult.OK;
            this.Dispose();
        }
コード例 #26
0
        public override bool Execute()
        {
            WaitForDebuggerIfEnabled();

            try
            {
                var includeFilters      = _include?.Split(',');
                var includeDirectories  = _includeDirectory?.Split(',');
                var excludeFilters      = _exclude?.Split(',');
                var excludedSourceFiles = _excludeByFile?.Split(',');
                var excludeAttributes   = _excludeByAttribute?.Split(',');
                var fileSystem          = DependencyInjection.Current.GetService <IFileSystem>();

                Coverage coverage = new Coverage(_path,
                                                 includeFilters,
                                                 includeDirectories,
                                                 excludeFilters,
                                                 excludedSourceFiles,
                                                 excludeAttributes,
                                                 _includeTestAssembly,
                                                 _singleHit,
                                                 _mergeWith,
                                                 _useSourceLink,
                                                 _logger,
                                                 DependencyInjection.Current.GetService <IInstrumentationHelper>(),
                                                 fileSystem);

                CoveragePrepareResult prepareResult = coverage.PrepareModules();
                InstrumenterState = new TaskItem(System.IO.Path.GetTempFileName());
                using (var instrumentedStateFile = fileSystem.NewFileStream(InstrumenterState.ItemSpec, FileMode.Open, FileAccess.Write))
                {
                    using (Stream serializedState = CoveragePrepareResult.Serialize(prepareResult))
                    {
                        serializedState.CopyTo(instrumentedStateFile);
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex);
                return(false);
            }

            return(true);
        }
コード例 #27
0
        public CoverageManager(CoverletSettings settings, IReporter reporter, ILogger coverletLogger)
        {
            // Store input vars
            this.Reporter = reporter;

            // Coverage object
            this.coverage = new Coverage(
                settings.TestModule,
                settings.IncludeFilters,
                settings.IncludeDirectories,
                settings.ExcludeFilters,
                settings.ExcludeSourceFiles,
                settings.ExcludeAttributes,
                settings.SingleHit,
                settings.MergeWith,
                settings.UseSourceLink,
                coverletLogger);
        }
コード例 #28
0
        /// <summary>
        /// The update coverage.
        /// </summary>
        /// <param name="id">
        ///     The id.
        /// </param>
        /// <param name="newList">
        ///     The new list.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool UpdateCoverage(int id, Coverage providerCoverage)
        {
            try
            {
                var currentCoverage =
                    this.db.ProviderCoverages.Single(c => c.LocationID == id & c.AreaID == providerCoverage.CountyId);

                currentCoverage.AreaID = providerCoverage.CountyId;

                this.db.Entry(currentCoverage).State = EntityState.Modified;
                this.db.SaveChanges();
                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
コード例 #29
0
        public override bool Execute()
        {
            try
            {
                var rules   = _excludeByFile?.Split(',');
                var filters = _exclude?.Split(',');

                _coverage = new Coverage(_path, Guid.NewGuid().ToString(), filters, rules);
                _coverage.PrepareModules();
            }
            catch (Exception ex)
            {
                Log.LogErrorFromException(ex);
                return(false);
            }

            return(true);
        }
コード例 #30
0
        public void OnSessionStartShouldPrepareModulesForCoverage()
        {
            Func <TestPlatformEqtTrace, TestPlatformLogger, string, IServiceCollection> serviceCollectionFactory = (TestPlatformEqtTrace eqtTrace, TestPlatformLogger logger, string testModule) =>
            {
                IServiceCollection serviceCollection = new ServiceCollection();
                Mock <IFileSystem> fileSystem        = new Mock <IFileSystem>();
                fileSystem.Setup(f => f.Exists(It.IsAny <string>())).Returns((string testLib) => testLib == "abc.dll");
                serviceCollection.AddTransient(_ => fileSystem.Object);

                serviceCollection.AddTransient <IRetryHelper, RetryHelper>();
                serviceCollection.AddTransient <IProcessExitHandler, ProcessExitHandler>();
                serviceCollection.AddTransient <ILogger, CoverletLogger>(_ => new CoverletLogger(eqtTrace, logger));
                serviceCollection.AddSingleton <IInstrumentationHelper, InstrumentationHelper>();
                serviceCollection.AddSingleton <ISourceRootTranslator, SourceRootTranslator>(serviceProvider => new SourceRootTranslator(testModule, serviceProvider.GetRequiredService <ILogger>(), serviceProvider.GetRequiredService <IFileSystem>()));
                return(serviceCollection);
            };

            _coverletCoverageDataCollector = new CoverletCoverageCollector(new TestPlatformEqtTrace(), _mockCoverageWrapper.Object, _mockCountDownEventFactory.Object, serviceCollectionFactory);
            _coverletCoverageDataCollector.Initialize(
                _configurationElement,
                _mockDataColectionEvents.Object,
                _mockDataCollectionSink.Object,
                null,
                _context);
            IDictionary <string, object> sessionStartProperties = new Dictionary <string, object>();
            IInstrumentationHelper       instrumentationHelper  =
                new InstrumentationHelper(new Mock <IProcessExitHandler>().Object,
                                          new Mock <IRetryHelper>().Object,
                                          new Mock <IFileSystem>().Object,
                                          new Mock <ILogger>().Object,
                                          new Mock <ISourceRootTranslator>().Object);

            Coverage coverage = new Coverage("abc.dll", null, null, null, null, null, true, true, "abc.json", true, It.IsAny <ILogger>(), instrumentationHelper, new Mock <IFileSystem>().Object, new Mock <ISourceRootTranslator>().Object, null);

            sessionStartProperties.Add("TestSources", new List <string> {
                "abc.dll"
            });
            _mockCoverageWrapper.Setup(x => x.CreateCoverage(It.IsAny <CoverletSettings>(), It.IsAny <ILogger>(), It.IsAny <IInstrumentationHelper>(), It.IsAny <IFileSystem>(), It.IsAny <ISourceRootTranslator>())).Returns(coverage);

            _mockDataColectionEvents.Raise(x => x.SessionStart += null, new SessionStartEventArgs(sessionStartProperties));

            _mockCoverageWrapper.Verify(x => x.CreateCoverage(It.Is <CoverletSettings>(y => y.TestModule.Contains("abc.dll")), It.IsAny <ILogger>(), It.IsAny <IInstrumentationHelper>(), It.IsAny <IFileSystem>(), It.IsAny <ISourceRootTranslator>()), Times.Once);
            _mockCoverageWrapper.Verify(x => x.PrepareModules(It.IsAny <Coverage>()), Times.Once);
        }
コード例 #31
0
        public void TestCoverageSkipModule__AssemblyMarkedAsExcludeFromCodeCoverage()
        {
            Mock <FileSystem> partialMockFileSystem = new Mock <FileSystem>();

            partialMockFileSystem.CallBase = true;
            partialMockFileSystem.Setup(fs => fs.NewFileStream(It.IsAny <string>(), It.IsAny <FileMode>(), It.IsAny <FileAccess>())).Returns((string path, FileMode mode, FileAccess access) =>
            {
                return(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read));
            });
            var loggerMock = new Mock <ILogger>();

            string excludedbyattributeDll = Directory.GetFiles(Path.Combine(Directory.GetCurrentDirectory(), "TestAssets"), "coverlet.tests.projectsample.excludedbyattribute.dll").First();
            // test skip module include test assembly feature
            var coverage = new Coverage(excludedbyattributeDll, new string[] { "[coverlet.tests.projectsample.excludedbyattribute*]*" }, Array.Empty <string>(), Array.Empty <string>(), Array.Empty <string>(), Array.Empty <string>(), true, false, string.Empty, false, loggerMock.Object, _instrumentationHelper, partialMockFileSystem.Object);
            CoveragePrepareResult result = coverage.PrepareModules();

            Assert.Empty(result.Results);
            loggerMock.Verify(l => l.LogVerbose(It.IsAny <string>()));
        }
コード例 #32
0
ファイル: CoverageTests.cs プロジェクト: umutozel/coverlet
        public void TestCoverage()
        {
            string module     = typeof(CoverageTests).Assembly.Location;
            string identifier = Guid.NewGuid().ToString();

            var directory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), identifier));

            File.Copy(module, Path.Combine(directory.FullName, Path.GetFileName(module)), true);

            var coverage = new Coverage(module, identifier);

            coverage.PrepareModules();

            var result = coverage.GetCoverageResult();

            Assert.Empty(result.Modules);

            directory.Delete(true);
        }
コード例 #33
0
        public override bool Execute()
        {
            try
            {
                var excludedSourceFiles = _excludeByFile?.Split(',');
                var excludeFilters      = _exclude?.Split(',');
                var includeFilters      = _include?.Split(',');

                _coverage = new Coverage(_path, excludeFilters, includeFilters, excludedSourceFiles, true);
                _coverage.PrepareModules();
            }
            catch (Exception ex)
            {
                Log.LogErrorFromException(ex);
                return(false);
            }

            return(true);
        }
コード例 #34
0
        private void AddTypesUsingAnyAffectedType()
        {
            foreach (var invoke in Coverage.SelectMany(e => e.Value).Where(invoke => !(invoke.From is TestMethod)))
            {
                if (IsInAffectedClass(invoke.Target) && IsAffectedMethod(invoke.Target) && !IsInAffectedClass(invoke.From))
                {
                    var from = ClassDiagram.ResolveType(invoke.From.TypeName);
                    if (from != null)
                    {
                        var fromMethod = from.Methods.First(m => m.Name.Equals(invoke.From.Name));
                        var target     = ClassDiagram.ResolveType(invoke.Target.TypeName);

                        AffectedTypes.Add(from);
                        Edges.Add(new AffectedEdge(from, target, Edge.Use));
                        MethodChanges.Add(new MethodChange(fromMethod, Change.Using));
                    }
                }
            }
        }
コード例 #35
0
 public static void Insurances()
 {
     f = Coverage.List("SELECT * FROM coverage ");
     AdvancedForm._Form1.FeedBack("Uploading Insurance... " + f.Count);
     foreach (var h in f)
     {
         string Query = "DELETE from coverage WHERE id ='" + h.Id + "'";
         MySQL.Query(Query);
         Coverage p = new Coverage(h.Id, h.CustomerID, h.Name, h.Type, h.Category, h.No, DateTime.Now.ToString("dd-MM-yyyy H:m:s"), "true", Helper.CompanyID, h.Expires);
         if (MySQL.Insert(p) != "")
         {
             AdvancedForm._Form1.FeedBack("Uploading ... " + h.Id.ToString());
             Coverage u = new Coverage(h.Id, h.CustomerID, h.Name, h.Type, h.Category, h.No, DateTime.Now.ToString("dd-MM-yyyy H:m:s"), "true", Helper.CompanyID, h.Expires);
             DBConnect.UpdateMySql(u, h.Id);
             AdvancedForm._Form1.FeedBack("Updating .. " + h.Id.ToString());
         }
     }
     AdvancedForm._Form1.FeedBack("Uploading Insurance Complete");
 }
コード例 #36
0
 public int CreateClientCoverage(Coverage clientCoverage)
 {
     try
     {
         using (var dbModel = InitiateDbContext())
         {
             //if (clientCoverage.Payor != null) dbModel.Payors.Attach( clientCoverage.Payor );
             //if (clientCoverage.Client != null) dbModel.Clients.Attach( clientCoverage.Client );
             dbModel.Coverages.Add(clientCoverage);
             dbModel.SaveChanges();
             return(clientCoverage.Id);
         }
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.ToString());
         throw;
     }
 }
コード例 #37
0
        private void FetchOperation(object sender, RoutedEventArgs e)
        {
            busyIndicator.IsBusy = true;

            //Get the root path for the XAP
            string src = Application.Current.Host.Source.ToString();

            //Get the application root, where 'ClientBin' is the known dir where the XAP is
            string appRoot = src.Substring(0, src.IndexOf("ClientBin"));

            Coverage coverage = (Coverage)cmbCoverage.SelectedItem;

            Uri reportURI = new Uri(string.Format(appRoot + "DummyAddressStickerReportGenerate.aspx?TEMPLATE_NAME={0}&FP_NO={1}&COVERAGE_ID={2}&RT_NO={3}&CELL_NO={4}",
                                                  "AddressLabels_Dummy.docx", txtFPNo.Text, coverage.ID, txtRTNo.Text, cellNo.Text),
                                    UriKind.Absolute);

            HtmlPage.Window.Navigate(reportURI, "_blank");
            busyIndicator.IsBusy = false;
        }
コード例 #38
0
 /// <summary>
 /// Updates the coverage passed in with the title from the Genius external policy coverage.
 /// </summary>
 /// <param name="xiapCoverage">The xiap coverage.</param>
 /// <param name="externalCoverage">The external coverage.</param>
 private void UpdateCoverage(Coverage xiapCoverage, IUWCoverage externalCoverage)
 {
     xiapCoverage.ExternalReference = externalCoverage.ExternalReference;
     CoverageVersion coverageVersion = (CoverageVersion)xiapCoverage.GetLatestVersion();
     if (coverageVersion != null)
     {
         coverageVersion.CoverageTitle = externalCoverage.CoverageTitle;
     }
 }
コード例 #39
0
 /// <summary>
 /// Updates the argued QuoteSummary object with MultiRate data. This is only used in ConsumerWeb.
 /// </summary>
 /// <param name="header">BusinessLogic.Header</param>
 /// <param name="quote">BusinessLogic.Quote</param>
 /// <param name="coverage">BusinessLogic.Coverage</param>
 /// <param name="qSummary">reference of the QuoteSummary object to update</param>
 public static void UpdateMultiRateToQuoteSummary(Header header, Quote quote, Coverage coverage, ref QuoteSummary qSummary)
 {
     switch (header.FormNumber)
     {
         case 3:
             BindMultiRateForForm3(header, quote, coverage, ref qSummary);
             break;
         case 4:
             BindMultiRateForForm4(header, quote, coverage, ref qSummary);
             break;
     }
 }
コード例 #40
0
        /// <summary>
        /// Updates the argued QuoteSummary object with MultiRate data.
        /// </summary>
        /// <param name="header">BusinessLogic.Header</param>
        /// <param name="quote">BusinessLogic.Quote</param>
        /// <param name="coverage">BusinessLogic.Coverage</param>
        /// <param name="qSummary">reference of the QuoteSummary object to update</param>
        private static void BindMultiRateForForm3(Header header, Quote quote, Coverage coverage, ref QuoteSummary qSummary)
        {
            DataTable table = DirectWebDAC.GetMultirate(header.SessionID);

            for (var i = 0; i < table.Rows.Count; i++)
            {
                string totalPremium = table.Rows[i]["PolicyPremiumAmt"].ToString().Trim().Replace("$", "");
                string deductible = table.Rows[i]["Deductible"].ToString().Trim();
                string windHailOrHurricane = (table.Rows[i]["WindHailOrHurricane"] == null) ? string.Empty : table.Rows[i]["WindHailOrHurricane"].ToString().Trim();
                decimal? covEAmount = (table.Rows[i]["CovEAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovEAmount"];
                decimal? covFAmount = (table.Rows[i]["CovFAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovFAmount"];
                decimal? covCAmount = (table.Rows[i]["CovCAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovCAmount"];
                decimal? covAAmount = (table.Rows[i]["CovAAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovAAmount"];
                decimal? increasedCovAAmount = (table.Rows[i]["IncreasedCovAAmount"] == null) ? 0 : (decimal?)table.Rows[i]["IncreasedCovAAmount"];
                int coveredPerils = (table.Rows[i]["coveredPerils"] == null) ? 0 : (int)table.Rows[i]["coveredPerils"];
                string multirateOptions = table.Rows[i]["MultirateOptions"].ToString().Trim();

                DateTime ratingDate = DirectWebDAC.GetRatingDate(DateTime.Parse(coverage.PolicyEffDate),
                                                                quote.InitialQuoteRequestDt.HasValue ? quote.InitialQuoteRequestDt.Value : DateTime.Now,
                                                                header.State);

                DataSet premiumDisplay = DirectWebDAC.GetPremiumDisplay(
                    Convert.ToInt32(table.Rows[i]["RatingCaseNumber"]),
                    header.PartnerID ?? -1,
                    header.State ?? "",
                    ratingDate,
                    (int)header.UnderwritingNumber);

                var premiumDiscounts = (ISODataProvider.GetPremiumDiscountsDataTable)premiumDisplay.Tables["GetPremiumDiscounts"];

                var discounts = new ControlDataSource(premiumDiscounts, "display", "premium", "Discounts");

                double totalDiscount = 0;
                foreach (var discount in discounts.Items)
                {
                    if (discount.Value == "" || discount.Key == "Total Discounts and Surcharges" || discount.Key == "ACV Roof Loss Settlement (Wind/Hail) for roofs older than 10 years")
                    {
                        continue;
                    }

                    double val = Convert.ToDouble(discount.Value);
                    if (val < 0)
                    {
                        totalDiscount = totalDiscount - val;
                    }
                }

                DirectWebDAC.InsertOrUpdateMultirate(header.SessionID, deductible, (Convert.ToInt32(table.Rows[i]["IsDeductibleSelected"]) == 1) ? 1 : 0, table.Rows[i]["RatingCaseNumber"].ToString().Trim(), totalPremium, windHailOrHurricane, totalDiscount.ToString(), covEAmount, covFAmount, multirateOptions, covCAmount, covAAmount, Convert.ToInt32(coveredPerils), string.Empty, 0, 0, 0, increasedCovAAmount);

                switch (multirateOptions)
                {
                    case "Option1":
                        qSummary.TotalPremium1 = totalPremium;
                        qSummary.Deductible1 = deductible;
                        qSummary.TotalDiscount1 = totalDiscount.ToString("f2");
                        qSummary.CovEAmount1 = covEAmount.ToString();
                        qSummary.CovFAmount1 = covFAmount.ToString();
                        qSummary.CovCAmount1 = covCAmount.ToString();
                        qSummary.CovAAmount1 = covAAmount.ToString();
                        qSummary.IncreasedCovAAmount1 = increasedCovAAmount.ToString();
                        qSummary.MultirateOption1 = multirateOptions;
                        qSummary.coveredPerils1 = (coveredPerils == 0) ? "standard" : "extended";
                        break;

                    case "Option2":
                        qSummary.TotalPremium2 = totalPremium;
                        qSummary.Deductible2 = deductible;
                        qSummary.TotalDiscount2 = totalDiscount.ToString("f2");
                        qSummary.CovEAmount2 = covEAmount.ToString();
                        qSummary.CovFAmount2 = covFAmount.ToString();
                        qSummary.CovCAmount2 = covCAmount.ToString();
                        qSummary.CovAAmount2 = covAAmount.ToString();
                        qSummary.IncreasedCovAAmount2 = increasedCovAAmount.ToString();
                        qSummary.MultirateOption2 = multirateOptions;
                        qSummary.coveredPerils2 = (coveredPerils == 0) ? "standard" : "extended";
                        break;

                    case "Option3":
                        qSummary.TotalPremium3 = totalPremium;
                        qSummary.Deductible3 = deductible;
                        qSummary.TotalDiscount3 = totalDiscount.ToString("f2");
                        qSummary.CovEAmount3 = covEAmount.ToString();
                        qSummary.CovFAmount3 = covFAmount.ToString();
                        qSummary.CovCAmount3 = covCAmount.ToString();
                        qSummary.CovAAmount3 = covAAmount.ToString();
                        qSummary.IncreasedCovAAmount3 = increasedCovAAmount.ToString();
                        qSummary.MultirateOption3 = multirateOptions;
                        qSummary.coveredPerils3 = (coveredPerils == 0) ? "standard" : "extended";
                        break;
                }
            }

            qSummary.CovAAmount = coverage.CovAAmount;
            qSummary.MedicalPaymentLimit = coverage.MedicalPaymentLimit;
            qSummary.PersonalLiabilityLimit = coverage.PersonalLiabilityLimit;
        }
コード例 #41
0
        /// <summary>
        /// Updates the argued QuoteSummary object with MultiRate data. This is only used in ConsumerWeb - HO4
        /// </summary>
        /// <param name="header">BusinessLogic.Header</param>
        /// <param name="quote">BusinessLogic.Quote</param>
        /// <param name="coverage">BusinessLogic.Coverage</param>
        /// <param name="qSummary">reference of the QuoteSummary object to update</param>
        private static void BindMultiRateForForm4(Header header, Quote quote, Coverage coverage, ref QuoteSummary qSummary)
        {
            DataTable table = DirectWebDAC.GetMultirate(header.SessionID);

            for (var i = 0; i < table.Rows.Count; i++)
            {
                var totalPremium = table.Rows[i]["PolicyPremiumAmt"].ToString().Trim().Replace("$", "");
                var deductible = table.Rows[i]["Deductible"].ToString().Trim();
                var covCAmount = (table.Rows[i]["CovCAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovCAmount"];
                var covEAmount = (table.Rows[i]["CovEAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovEAmount"];
                var covFAmount = (table.Rows[i]["CovFAmount"] == null) ? 0 : (decimal?)table.Rows[i]["CovFAmount"];
                var multirateOptions = table.Rows[i]["MultirateOptions"].ToString().Trim();

                DateTime ratingDate = DirectWebDAC.GetRatingDate(DateTime.Parse(coverage.PolicyEffDate),
                                                                quote.InitialQuoteRequestDt.HasValue ? quote.InitialQuoteRequestDt.Value : DateTime.Now,
                                                                header.State);

                var premiumDisplay = DirectWebDAC.GetPremiumDisplay(
                    Convert.ToInt32(table.Rows[i]["RatingCaseNumber"].ToString()), header.PartnerID ?? -1,
                    header.State ?? "", ratingDate, (int)header.UnderwritingNumber);

                var premiumDiscounts = (ISODataProvider.GetPremiumDiscountsDataTable)premiumDisplay.Tables["GetPremiumDiscounts"];

                var discounts = new ControlDataSource(premiumDiscounts, "display", "premium", "Discounts");

                double totalDiscount = 0;
                foreach (var discount in discounts.Items)
                {
                    if (discount.Value == "" || discount.Key == "Total Discounts and Surcharges" || discount.Key == "ACV Roof Loss Settlement (Wind/Hail) for roofs older than 10 years")
                    {
                        continue;
                    }

                    double val = Convert.ToDouble(discount.Value);
                    if (val < 0)
                    {
                        totalDiscount = totalDiscount - val;
                    }
                }

                var EftStateFee = header.State == "AL" ? "$2.60" : header.State == "KY" ? "$2.50" : header.State == "NC" ? "$0.00" : header.State == "TN" ? "$0.00" : header.State.Equals("FL") ? "$1.00" : "$3.00";

                string totalPrice = (Convert.ToDouble(totalPremium) + totalDiscount).ToString();

                string monthlyPaymentPlan;
                string downPayment;
                int numInstallments;

                Structure structure = Structure.GetStructure(header.SessionID);

                int propertyType = 0;

                if (!String.IsNullOrEmpty(structure.PropertyType))
                {
                    propertyType = Convert.ToInt32(structure.PropertyType);
                }

                QuoteServices.ProcessMonthlyPremiumData(header.State, quote.CompanysQuoteNumber, ((DateTime)ratingDate).ToString("MM/dd/yyyy"), totalPremium, propertyType,
                    out monthlyPaymentPlan, out downPayment, out numInstallments);

                DirectWebDAC.InsertOrUpdateMultirate(header.SessionID, deductible, (Convert.ToInt32(table.Rows[i]["IsDeductibleSelected"]) == 1) ? 1 : 0, table.Rows[i]["RatingCaseNumber"].ToString().Trim(), totalPremium, string.Empty, totalDiscount.ToString(), covEAmount, covFAmount, multirateOptions, 0, 0, 0, totalPrice, Convert.ToDecimal(monthlyPaymentPlan.Trim().Replace("$", "")), Convert.ToDecimal(downPayment.Trim().Replace("$", "")), numInstallments, 0);

                switch (multirateOptions)
                {
                    case "Option1":
                        qSummary.TotalPremium1 = totalPremium;
                        qSummary.Deductible1 = deductible;
                        qSummary.TotalDiscount1 = totalDiscount.ToString("f2");
                        qSummary.CovCAmount1 = covCAmount.ToString();
                        qSummary.CovEAmount1 = covEAmount.ToString();
                        qSummary.CovFAmount1 = covFAmount.ToString();
                        qSummary.MultirateOption1 = multirateOptions;
                        qSummary.TotalPrice1 = totalPrice;
                        qSummary.MonthlyPayPlan1 = monthlyPaymentPlan;
                        qSummary.Downpayment1 = downPayment;
                        qSummary.NumInstallments1 = numInstallments;

                        break;

                    case "Option2":
                        qSummary.TotalPremium2 = totalPremium;
                        qSummary.Deductible2 = deductible;
                        qSummary.TotalDiscount2 = totalDiscount.ToString("f2");
                        qSummary.CovCAmount2 = covCAmount.ToString();
                        qSummary.CovEAmount2 = covEAmount.ToString();
                        qSummary.CovFAmount2 = covFAmount.ToString();
                        qSummary.MultirateOption2 = multirateOptions;
                        qSummary.TotalPrice2 = totalPrice;
                        qSummary.MonthlyPayPlan2 = monthlyPaymentPlan;
                        qSummary.Downpayment2 = downPayment;
                        qSummary.NumInstallments2 = numInstallments;
                        break;

                    case "Option3":
                        qSummary.TotalPremium3 = totalPremium;
                        qSummary.Deductible3 = deductible;
                        qSummary.TotalDiscount3 = totalDiscount.ToString("f2");
                        qSummary.CovCAmount3 = covCAmount.ToString();
                        qSummary.CovEAmount3 = covEAmount.ToString();
                        qSummary.CovFAmount3 = covFAmount.ToString();
                        qSummary.MultirateOption3 = multirateOptions;
                        qSummary.TotalPrice3 = totalPrice;
                        qSummary.MonthlyPayPlan3 = monthlyPaymentPlan;
                        qSummary.Downpayment3 = downPayment;
                        qSummary.NumInstallments3 = numInstallments;
                        break;
                }
            }

            qSummary.MedicalPaymentLimit = coverage.MedicalPaymentLimit;
            qSummary.PersonalLiabilityLimit = coverage.PersonalLiabilityLimit;
        }
コード例 #42
0
 public void Setup()
 {
     coverage = new Coverage();
     BaseTestClass.SetConfiguration();
 }
コード例 #43
0
 public void Setup()
 {
     coverage = new Coverage();
     restClient = new Mock<IRequestExecute>();
     param = new Hashtable();
 }
コード例 #44
0
        /// <summary>
        /// Creates a ControlDataSource object containing the values of the wind/hail/hurricane options. This is used in multirate
        /// process so each deductible can be calculated with the correct default selection.
        /// 
        /// The logic of local variable "ATerritoryOrBCEG" was duplicated from CoveragesDataSourceProvider.cs, which is the origination
        /// of the "GetWindHailDropdown" logic.
        /// </summary>
        /// <param name="quoteHeader">User-value container</param>
        /// <param name="coverage">coverage data value container</param>
        /// <param name="abOutputs">address broker value container</param>
        /// <returns>ControlDataSource - only to be used w/in ProcessMultirate()</returns>
        private ControlDataSource GetWindHailDataSource(QuoteHeader quoteHeader, Coverage coverage, AddressBrokerOutput abOutputs)
        {
            short? ATerritoryOrBCEG = (quoteHeader.State == "GA") && (abOutputs.BuildingCodeEffectivenessGradeCd != null)
                    ? (short?)Convert.ToInt32(abOutputs.BuildingCodeEffectivenessGradeCd)
                    : abOutputs.ATerritory;

            DataTable dtWindHail = DirectWebDAC.GetWindHailDropdown(
                quoteHeader.State,
                quoteHeader.ProgramType,
                quoteHeader.FormCode,
                abOutputs.WindPool,
                quoteHeader.RatingVersion,
                (int) abOutputs.ShoreLineDistance,
                ATerritoryOrBCEG,
                Convert.ToInt32(abOutputs.RatingTerritory),
                coverage.PolicyEffDate,
                string.IsNullOrEmpty(quoteHeader.OriginalQuoteDate) == false ? DateTime.Parse(quoteHeader.OriginalQuoteDate) : DateTime.Now,
                abOutputs.LandSlide,
                null,
                (decimal) coverage.CovAAmount, Convert.ToInt32(abOutputs.GridId ?? 0));

            if (dtWindHail != null)
            {
                return new ControlDataSource(dtWindHail, "Deductible", "Deductible");
            }

            return null;
        }
コード例 #45
0
ファイル: BullseyeToEmma.cs プロジェクト: gbruce/cover2emma
 private emma.coverage[] ToCoverage()
 {
     var cov = new Coverage();
     cov.Add(cd.Covered > 0 ? 1 : 0, 1);
     return Utils.CreateCoverage(cov, fn, cd, new Coverage());
 }
コード例 #46
0
ファイル: BullseyeToEmma.cs プロジェクト: gbruce/cover2emma
        private emma.report ConvertToEmma(bullseye.BullseyeCoverage dc)
        {
            var folders = new Dictionary<string, emma.package>();

            // Create packages

            ForEachSrc(dc, (path, folder, src) =>
                           	{
                           		if (!folders.ContainsKey(path))
                           		{
                           			var package = new emma.package();
                           			package.name = ConvertPathToPackageName(path);
                           			package.coverage = CreateCoverage(folder);
                           			package.srcfile = new emma.srcfile[0];

                           			folders.Add(path, package);
                           		}

                           		var files = new List<emma.srcfile>(folders[path].srcfile);
                           		files.Add(Convert(src));
                           		folders[path].srcfile = files.ToArray();
                           	});

            // Add classes to the package

            foreach (var package in folders.Values)
            {
                Coverage classesCov = new Coverage();
                foreach (var src in package.srcfile)
                {
                    var covs = Utils.ParseCoverages(src.coverage);
                    classesCov.Add(covs.ClassCovered, covs.ClassTotal);
                }

                var packageCovs = Utils.ParseCoverages(package.coverage);

                package.coverage = Utils.CreateCoverage(classesCov.Covered, classesCov.Total, packageCovs.MethodCovered,
                                                        packageCovs.MethodTotal, packageCovs.BlockCovered, packageCovs.BlockTotal,
                                                        packageCovs.LineCovered, packageCovs.LineTotal);
            }

            return Utils.CreateReport(folders.Values);
        }