コード例 #1
0
        public void TestGetFileNameException()
        {
            // Arrange
            using (BlobController controller = new BlobController(new ToDoMockBlobService()))
            {
                // Act
                var result = controller.GetFileName();

                //Assert
                Assert.IsTrue(result.Data.ToString() == "error", "Exception occur so error.");
            }
        }
コード例 #2
0
        public void TestGetFileName()
        {
            // Arrange
            using (BlobController controller = new BlobController(new BlobBL(new Blob())))
            {
                // Act
                var result = controller.GetFileName();

                //Assert
                Assert.IsFalse(result.Data.ToString() == "error", "Exception occur so error.");
            }
        }
コード例 #3
0
        public void TestGetFileNameException()
        {
            // Arrange
            using (BlobController controller = new BlobController(new ToDoMockBlobService()))
            {
                controller.Request = new HttpRequestMessage
                {
                    Method = HttpMethod.Get
                };

                // Act
                var response = controller.GetFileName();

                //Assert
                Assert.AreEqual(HttpStatusCode.InternalServerError, response.StatusCode);
            }
        }
コード例 #4
0
        public void TestGetFileName()
        {
            // Arrange
            using (BlobController controller = new BlobController(new BlobBL(new Blob())))
            {
                controller.Request = new HttpRequestMessage
                {
                    Method = HttpMethod.Get
                };

                // Act
                var response = controller.GetFileName();

                //Assert
                //Assert
                Assert.IsTrue(response.IsSuccessStatusCode);
                Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
            }
        }