Example #1
0
        public void HistoryApp_Read_InValid_Data_Bogus_Should_Fail()
        {
            // Arrange
            var myController = new HistoryAppController();

            // Act
            var result = myController.Read("bogus");

            // Assert
            Assert.IsNotNull(result);
        }
        public void HistoryApp_Read_Valid_Data_Should_Pass()
        {
            // Arrange
            var myController = new HistoryAppController();
            var myData       = BiliWeb.Backend.HistoryAppBackend.Instance.Index().FirstOrDefault();

            // Act
            var result = myController.Read(myData.ID) as ViewResult;

            // Assert
            Assert.IsNotNull(result.Model);
        }
        public void HistoryApp_Read_Get_Data_Null_Should_Fail()
        {
            // Arrange
            var myController = new HistoryAppController();

            // Act
            var result = myController.Read(null);

            // Reset

            // Assert
            Assert.IsNotNull(result);
        }
        public void HistoryApp_Read_Get_InValid_Data_Null_Should_Fail()
        {
            // Arrange
            var myController = new HistoryAppController();

            // Act
            var result = (NotFoundResult)myController.Read(null);

            // Reset

            // Assert
            Assert.AreEqual(404, result.StatusCode);
        }