@@ -0,0 +1,1928 @@
+package com.soulgalore.servlet;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport static org.hamcrest.Matchers.is;%0Aimport org.junit.Test;%0A%0Apublic class WhenAThumbnailsCreated %7B%0A%0A%09%0A%09@Test%0A%09public void theGeneratedFilePathShouldNotBeNull() %7B%0A%09%09Thumbnail thumbnail = new Thumbnail(%22mySuperImage-120x29.png%22);%0A%09%09assertNotNull(thumbnail.getGeneratedFilePath());%09%0A%09%7D%0A%0A%09@Test%0A%09public void thetImageDimensionsAreRight() %7B%0A%09%09%0A%09%09String dimensions = %22120x29%22;%0A%09%09Thumbnail thumbnail = new Thumbnail(%22mySuperImage-%22 + dimensions + %22.png%22);%0A%09%09assertThat(thumbnail.getImageDimensions(),is(dimensions));%0A%09%09%0A%09%09thumbnail = new Thumbnail(%22my-Super_Im.ag._With_.png.----crazy-name-%22 + dimensions + %22.png%22);%0A%09%09assertThat(thumbnail.getImageDimensions(),is(dimensions));%0A%09%7D%0A%0A%09%0A%09@Test%0A%09public void theFileNameShouldBeRight() %7B%0A%09%09Thumbnail thumbnail = new Thumbnail(%22mySuperImage-120x29.png%22);%0A%09%09assertThat(thumbnail.getOriginalImageName(),is(%22mySuperImage-120x29.png%22));%0A%09%7D%0A%0A%09@Test%0A%09public void theOriginalNameShouldBeRight() %7B%0A%09%09Thumbnail thumbnail = new Thumbnail(%22mySuperImage-120x29.png%22);%0A%09%09assertThat(thumbnail.getOriginalImageName(),is(%22mySuperImage%22));%0A%09%09%0A%09%09thumbnail = new Thumbnail(%22-120x29-mySuperImage-120x29.png%22);%0A%09%09assertThat(thumbnail.getOriginalImageName(),is(%22-120x29-mySuperImage%22));%0A%0A%09%7D%0A%0A%09@Test%0A%09public void theOriginalFullnameShouldBeRght() %7B%0A%09%09Thumbnail thumbnail = new Thumbnail(%22mySuperImage-120x29.png%22);%0A%09%09assertThat(thumbnail.getOriginalImageNameWithEnding(),is(%22mySuperImage.png%22));%0A%09%09%0A%09%09thumbnail = new Thumbnail(%22imagee-120x29-1267x98.jpg%22);%0A%09%09assertThat(thumbnail.getOriginalImageNameWithEnding(),is(%22imagee.png%22));%0A%09%09%0A%09%7D%0A%0A%09@Test%0A%09public void theFileEndingShoukdBeRight() %7B%0A%09%09Thumbnail thumbnail = new Thumbnail(%22mySuperImage-120x29.png%22);%0A%09%09assertThat(thumbnail.getImageFileEnding(),is(%22.png%22));%0A%09%09%0A%09%09thumbnail = new Thumbnail(%22mySuper.gif.Image-120x29.jpg%22);%0A%09%09assertThat(thumbnail.getImageFileEnding(),is(%22.jpg%22));%09%0A%0A%09%7D%0A%0A%09%0A%7D%0A

test of thumbnail class