当前位置: 首页>>代码示例>>C#>>正文


C# PersistentEvent.GetLocation方法代码示例

本文整理汇总了C#中Exceptionless.Core.Models.PersistentEvent.GetLocation方法的典型用法代码示例。如果您正苦于以下问题:C# PersistentEvent.GetLocation方法的具体用法?C# PersistentEvent.GetLocation怎么用?C# PersistentEvent.GetLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exceptionless.Core.Models.PersistentEvent的用法示例。


在下文中一共展示了PersistentEvent.GetLocation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WillNotSetLocation

        public async Task WillNotSetLocation() {
            var plugin = new GeoPlugin(await GetResolverAsync(Log));
            var ev = new PersistentEvent { Geo = GREEN_BAY_COORDINATES };
            await plugin.EventBatchProcessingAsync(new List<EventContext> { new EventContext(ev) });

            Assert.Equal(GREEN_BAY_COORDINATES, ev.Geo);
            Assert.Null(ev.GetLocation());
        }
开发者ID:rpotalara,项目名称:Exceptionless,代码行数:8,代码来源:GeoTests.cs

示例2: WillResetLocation

        public async Task WillResetLocation(string geo) {
            var plugin = new GeoPlugin(await GetResolverAsync(Log));
            
            var ev = new PersistentEvent { Geo = geo };
            await plugin.EventBatchProcessingAsync(new List<EventContext> { new EventContext(ev) });

            Assert.Null(ev.Geo);
            Assert.Null(ev.GetLocation());
        }
开发者ID:rpotalara,项目名称:Exceptionless,代码行数:9,代码来源:GeoTests.cs

示例3: WillSetLocationFromGeo

        public async Task WillSetLocationFromGeo() {
            var plugin = new GeoPlugin(await GetResolverAsync(Log));
            var ev = new PersistentEvent { Geo = GREEN_BAY_IP };
            await plugin.EventBatchProcessingAsync(new List<EventContext> { new EventContext(ev) });

            Assert.NotNull(ev.Geo);
            Assert.NotEqual(GREEN_BAY_IP, ev.Geo);

            var location = ev.GetLocation();
            Assert.Equal("US", location?.Country);
            Assert.Equal("WI", location?.Level1);
            Assert.Equal("Green Bay", location?.Locality);
        }
开发者ID:rpotalara,项目名称:Exceptionless,代码行数:13,代码来源:GeoTests.cs

示例4: WillSetMultipleFromEmptyGeo

        public async Task WillSetMultipleFromEmptyGeo() {
            var plugin = new GeoPlugin(await GetResolverAsync(Log));

            var ev = new PersistentEvent();
            var greenBayEvent = new PersistentEvent();
            greenBayEvent.SetEnvironmentInfo(new EnvironmentInfo { IpAddress = GREEN_BAY_IP });
            var irvingEvent = new PersistentEvent();
            irvingEvent.SetEnvironmentInfo(new EnvironmentInfo { IpAddress = IRVING_IP });
            await plugin.EventBatchProcessingAsync(new List<EventContext> {
                new EventContext(ev),
                new EventContext(greenBayEvent),
                new EventContext(irvingEvent)
            });

            Assert.Equal(GREEN_BAY_COORDINATES, greenBayEvent.Geo);
            var location = greenBayEvent.GetLocation();
            Assert.Equal("US", location?.Country);
            Assert.Equal("WI", location?.Level1);
            Assert.Equal("Green Bay", location?.Locality);

            Assert.Equal(IRVING_COORDINATES, irvingEvent.Geo);
            location = irvingEvent.GetLocation();
            Assert.Equal("US", location?.Country);
            Assert.Equal("TX", location?.Level1);
            Assert.Equal("Irving", location?.Locality);
        }
开发者ID:rpotalara,项目名称:Exceptionless,代码行数:26,代码来源:GeoTests.cs

示例5: WillSetLocationFromEnvironmentInfoInfo

        public async Task WillSetLocationFromEnvironmentInfoInfo() {
            var plugin = new GeoPlugin(await GetResolverAsync(Log));
            var ev = new PersistentEvent();
            ev.SetEnvironmentInfo(new EnvironmentInfo { IpAddress = $"127.0.0.1,{GREEN_BAY_IP}" });
            await plugin.EventBatchProcessingAsync(new List<EventContext> { new EventContext(ev) });

            Assert.NotNull(ev.Geo);

            var location = ev.GetLocation();
            Assert.Equal("US", location?.Country);
            Assert.Equal("WI", location?.Level1);
            Assert.Equal("Green Bay", location?.Locality);
        }
开发者ID:rpotalara,项目名称:Exceptionless,代码行数:13,代码来源:GeoTests.cs

示例6: WillSetLocationFromRequestInfo

        public async Task WillSetLocationFromRequestInfo() {
            var plugin = new GeoPlugin(await GetResolverAsync());
            var ev = new PersistentEvent();
            ev.AddRequestInfo(new RequestInfo { ClientIpAddress = GREEN_BAY_IP });
            await plugin.EventBatchProcessingAsync(new List<EventContext> { new EventContext(ev) });

            Assert.NotNull(ev.Geo);

            var location = ev.GetLocation();
            Assert.Equal("US", location?.Country);
            Assert.Equal("WI", location?.Level1);
            Assert.Equal("Green Bay", location?.Locality);
        }
开发者ID:skoub,项目名称:Exceptionless,代码行数:13,代码来源:GeoTests.cs

示例7: WillNotSetFromMultipleGeo

        public async Task WillNotSetFromMultipleGeo() {
            var plugin = new GeoPlugin(await GetResolverAsync());

            var ev = new PersistentEvent();
            var greenBayEvent = new PersistentEvent { Geo = GREEN_BAY_IP };
            var irvingEvent = new PersistentEvent { Geo = IRVING_IP };
            await plugin.EventBatchProcessingAsync(new List<EventContext> {
                new EventContext(ev),
                new EventContext(greenBayEvent),
                new EventContext(irvingEvent)
            });

            Assert.Equal(GREEN_BAY_COORDINATES, greenBayEvent.Geo);
            var location = greenBayEvent.GetLocation();
            Assert.Equal("US", location?.Country);
            Assert.Equal("WI", location?.Level1);
            Assert.Equal("Green Bay", location?.Locality);

            Assert.Equal(IRVING_COORDINATES, irvingEvent.Geo);
            location = irvingEvent.GetLocation();
            Assert.Equal("US", location?.Country);
            Assert.Equal("TX", location?.Level1);
            Assert.Equal("Irving", location?.Locality);
        }
开发者ID:skoub,项目名称:Exceptionless,代码行数:24,代码来源:GeoTests.cs


注:本文中的Exceptionless.Core.Models.PersistentEvent.GetLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。