public RandomCustomerFromListFixture( SpCustomerApi api )
		{
			var apiResult = api.GetCustomerList();
			Assert.Equal( ResponseStatus.Completed, apiResult.ResponseStatus );
			Assert.Equal( HttpStatusCode.OK, apiResult.StatusCode );
			Assert.NotNull( apiResult.Data.results );
			Assert.True( apiResult.Data.results.Any(), GetType().Name + " requires the target login to have at least one Customer" );
			Selected = apiResult.Data.results.ElementAtRandom();
		}
Пример #2
0
				public static void ShouldUpdateCustomerLinkForWellKnownTestCustomer( [Frozen] SpIssueApi api, RandomLicenseFromListFixture license, SpCustomerApi customerApi )
				{
					var licenseData = license.Selected;
					var customerData = customerApi.GetCustomerList( "$filter=Name eq Test" ).Data.results.Single();
					var signedCustomerData = customerApi.GetCustomer( customerData._links.self.href ).Data;
					UpdateAndVerifyCustomerLink( api, licenseData, signedCustomerData );
				}
Пример #3
0
		public static void ShouldHaveAtLeastOneItem( SpCustomerApi api )
		{
			var response = api.GetCustomerList();
			Assert.Equal( HttpStatusCode.OK, response.StatusCode );
			Assert.NotEmpty( response.Data.results );
		}
Пример #4
0
		public static void ShouldAlwaysBeAvailable( SpCustomerApi api )
		{
			var response = api.GetCustomerList();
			Assert.Equal( HttpStatusCode.OK, response.StatusCode );
		}
Пример #5
0
		static void FilterByKnownExternalIdShouldReturnOneOrMoreCustomersWithThatExternalId( SpCustomerApi api, RandomCustomerFromListFixture preSelectedCustomer )
		{
			var id = preSelectedCustomer.Selected.ExternalId;
			var response = api.GetCustomerList( "$filter=ExternalId eq '" + id + '"' );
			Assert.True( response.Data.results.All( x => id == x.ExternalId ), "Did not find '" + id + "' in: " + string.Join( ", ", from r in response.Data.results select r.ExternalId ) );
		}