public void FlickrImages_ConstructorWithValidQueryInput_StatusOKAndQueryMatchAndEmptyList() { // Arrange const string QUERY = "test"; var mockFlickrImages = new FlickrImages(QUERY); // Act // Assert Assert.IsTrue(mockFlickrImages.StatusCode == HttpStatusCode.OK); Assert.AreEqual(mockFlickrImages.Querry, QUERY); Assert.IsNotNull(mockFlickrImages.Images); Assert.IsTrue(mockFlickrImages.Images.Count() == 0); }
public void FlickrImages_ExceptionConstructor_ExceptionProvidedStatusCodeAndMessage() { // Arrange const string QUERY = "test"; const string ERROR_MSG = "error message"; const HttpStatusCode ERROR_CODE = HttpStatusCode.BadRequest; var mockFlickrImages = new FlickrImages( QUERY, new Exception(), ERROR_CODE, ERROR_MSG ); // Act // Assert Assert.IsTrue(mockFlickrImages.IsError); Assert.IsTrue(mockFlickrImages.Ex != null); Assert.AreEqual(mockFlickrImages.Querry, QUERY); Assert.IsTrue(mockFlickrImages.StatusCode == ERROR_CODE); Assert.AreEqual(mockFlickrImages.StatusMessage, ERROR_MSG); }