public void ThumbnailSmallOrTinyMeta_InputBadRequest() { var storageSelector = new FakeSelectorStorage(ArrangeStorage()); var controller = new ThumbnailController(_query, storageSelector);; var actionResult = controller.ThumbnailSmallOrTinyMeta("../") as BadRequestResult; Assert.AreEqual(400, actionResult.StatusCode); }
public void ThumbnailSmallOrTinyMeta_NotFound() { var storage = new FakeIStorage(); var controller = new ThumbnailController(_query, new FakeSelectorStorage(storage)); controller.ControllerContext.HttpContext = new DefaultHttpContext(); var actionResult = controller.ThumbnailSmallOrTinyMeta("404filehash") as NotFoundObjectResult; var thumbnailAnswer = actionResult.StatusCode; Assert.AreEqual(404, thumbnailAnswer); }
public void ThumbnailSmallOrTinyMeta_GetLargeResultWhenAllAreMissing() { var storage = new FakeIStorage(new List <string> { "/" }, new List <string> { ThumbnailNameHelper.Combine("test", ThumbnailSize.Large) }); var controller = new ThumbnailController(_query, new FakeSelectorStorage(storage)); controller.ControllerContext.HttpContext = new DefaultHttpContext(); controller.ThumbnailSmallOrTinyMeta("test"); controller.Response.Headers.TryGetValue("x-image-size", out var value); Assert.AreEqual(ThumbnailSize.Large.ToString(), value.ToString()); }