Пример #1
0
		public static void LandingPageShouldReturnHtml( SpApi spApi )
		{
			var request = new RestRequest( spApi.GetApiPrefix(ApiType.WebApiRoot) );
			request.AddHeader( "Accept", "text/html" );
			var response = spApi.Execute( request );
			Assert.Equal( HttpStatusCode.OK, response.StatusCode );
			Assert.True( response.ContentType.StartsWith( "text/html" ) );
		}
Пример #2
0
		public static void LandingPageShouldContainSignedVendorId( SpApi spApi )
		{
			var request = new RestRequest( spApi.GetApiPrefix( ApiType.WebApiRoot ) );
			request.AddHeader( "Accept", "text/html" );
			var response = spApi.Execute( request );
			Assert.Equal( HttpStatusCode.OK, response.StatusCode );
			Assert.True( response.ContentType.StartsWith( "text/html" ) );

			HtmlDocument doc = new HtmlDocument();
			doc.LoadHtml( response.Content );
			var node = doc.DocumentNode.SelectSingleNode( "//span[@data-claimid='vendorid']" );
			Assert.NotNull( node );
			Assert.Contains( "bff714f1-3c88-40e7-9e78-a73c041ac8eb", node.InnerText );
		}