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


C# ServiceCollection.Last方法代码示例

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


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

示例1: DefinitionPassbookContainsService

        public void DefinitionPassbookContainsService()
        {
            ServiceCollection services = new ServiceCollection();
            DefinitionTests.DefinePassbook(services);

            Assert.AreEqual(1, services.Count);
            Assert.IsNotNull(services.CurrentService);
            Assert.AreEqual(services.Last(), services.CurrentService);
            Assert.AreEqual("Passbook", services.CurrentService.Name);
        }
开发者ID:ChadBurggraf,项目名称:small-fry,代码行数:10,代码来源:DefinitionTests.cs

示例2: DefinitionPassbookContainsGetLatestVersionOfPassEndpointAndMethods

        public void DefinitionPassbookContainsGetLatestVersionOfPassEndpointAndMethods()
        {
            ServiceCollection services = new ServiceCollection();
            DefinitionTests.DefinePassbook(services);

            EndpointCollection endpoints = services.Last().Endpoints as EndpointCollection;
            Assert.IsNotNull(endpoints);
            Assert.IsTrue(endpoints.Any());
            Assert.AreEqual("v1/passes/{passTypeIdentifier}/{serialNumber}", endpoints.First().Route.ToString());

            MethodCollection methods = endpoints.First().Methods as MethodCollection;
            Assert.IsNotNull(methods);
            Assert.AreEqual(1, methods.Count());
            Assert.AreEqual(MethodType.Get, methods.First().MethodType);
        }
开发者ID:ChadBurggraf,项目名称:small-fry,代码行数:15,代码来源:DefinitionTests.cs

示例3: DefinitionPassbookContainsDeviceUnregistrationEndpointAndMethods

        public void DefinitionPassbookContainsDeviceUnregistrationEndpointAndMethods()
        {
            ServiceCollection services = new ServiceCollection();
            DefinitionTests.DefinePassbook(services);

            EndpointCollection endpoints = services.Last().Endpoints as EndpointCollection;
            Assert.IsNotNull(endpoints);
            Assert.IsTrue(3 <= endpoints.Count());
            Assert.AreEqual("v1/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}/{serialNumber}", endpoints.ElementAt(2).Route.ToString());

            MethodCollection methods = endpoints.ElementAt(2).Methods as MethodCollection;
            Assert.IsNotNull(methods);
            Assert.AreEqual(1, methods.Count());
            Assert.AreEqual(MethodType.Delete, methods.First().MethodType);
        }
开发者ID:ChadBurggraf,项目名称:small-fry,代码行数:15,代码来源:DefinitionTests.cs


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