public void WhenImageInvoked_FileIsReturned() { Mock <IFileStorageService> fileStorageServiceMock = new Mock <IFileStorageService>(); ResourcesController resourcesController = new ResourcesController(fileStorageServiceMock.Object); Byte[] fileBytes = new Byte[] {}; fileStorageServiceMock.Setup(x => x.RetrieveFile("test")).Returns(fileBytes); var result = resourcesController.Image("test") as FileContentResult; Assert.AreEqual(fileBytes, result.FileContents); }