예제 #1
0
        public void GetEmployeePicture()
        {
            Guid   employeeId    = Guid.NewGuid();
            Stream pictureStream = new MemoryStream();

            repository.GetEmployeePicture(employeeId).Returns(pictureStream);

            HttpResponseMessage result = sut.GetEmployeePicture(employeeId);
            var resultContent          = result.Content as ByteArrayContent;

            Assert.AreEqual(HttpStatusCode.OK, result.StatusCode);
            Assert.IsNotNull(resultContent);
            Assert.AreEqual("image/jpg", resultContent.Headers.ContentType.MediaType);
        }