public void CallingImageContentReturnsStream() { var dataAccessMock = new Mock <IImageRepository>(); var stream = new MemoryStream(); stream.WriteByte(1); dataAccessMock.Setup(x => x.GetImageContent(It.IsAny <string>())).Returns(stream); var controller = new ImagesController(dataAccessMock.Object, null, null); var guid = Guid.NewGuid().ToString(); var result = controller.GetImageContent(guid); //check if its image/jpeg Assert.NotNull(result); // Assert.IsTrue(true); }