Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. [TestClass]
  2.     public class IntegrationTests
  3.     {
  4.         [TestMethod]
  5.         public void Should_ResponseStatus200_When_HashIsCorrect()
  6.         {
  7.             var hashProvider = new Crc32Provider();
  8.             PhotoService photoService = new PhotoService(hashProvider);
  9.             string url =  photoService.GetImageUrl(200, 200, "p172/i/851300ee84c2b80ed40f51ed26d866fc/ba3ee1b5-1b44-458e-b2b5-602a4dca78eb.png");
  10.  
  11.             var request = (HttpWebRequest)WebRequest.Create(url);
  12.             request.Proxy = null;
  13.  
  14.             using (var response = (HttpWebResponse)request.GetResponse())
  15.             {
  16.                 Assert.AreEqual(response.StatusCode, HttpStatusCode.OK);      
  17.             }
  18.  
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement