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."); } }
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."); } }
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); } }
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); } }