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); }
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); }
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); }