예제 #1
0
            public void ReturnsAnOkHttpStatusCode()
            {
                // Arrange
                var uploadController = new UploadController(new Mock <IUploadTracker>().Object)
                {
                    Request = new HttpRequestMessage()
                };

                // Act
                var httpResponseMessage = uploadController.Get(new RawUpload());

                // Assert
                Assert.Equal(httpResponseMessage.StatusCode, HttpStatusCode.OK);
            }
예제 #2
0
            public void ReturnsAnHttpResponseMesssageForTheRequest()
            {
                // Arrange
                var httpRequestMessage = new HttpRequestMessage();
                var uploadController   = new UploadController(new Mock <IUploadTracker>().Object)
                {
                    Request = httpRequestMessage
                };

                // Act
                var httpResponseMessage = uploadController.Get(new RawUpload());

                // Assert
                Assert.Equal(httpResponseMessage.RequestMessage, httpRequestMessage);
            }
예제 #3
0
            public void SavesTheUpload()
            {
                // Arrange
                var uploadTracker    = new Mock <IUploadTracker>();
                var uploadController = new UploadController(uploadTracker.Object)
                {
                    Request = new HttpRequestMessage()
                };

                // Act
                var upload = new RawUpload();

                uploadController.Get(upload);

                // Assert
                uploadTracker.Verify(tracker => tracker.Save(upload));
            }