Пример #1
0
        public void GetReserveIdShouldNot()
        {
            // Arrange
            int id = 1000;
            ReservesController controller = new ReservesController();

            // Act
            IHttpActionResult actionResult = controller.GetReserve(id);
            var contentResult = actionResult as NotFoundResult;

            // Assert
            Assert.IsType <NotFoundResult>(actionResult);
        }
Пример #2
0
        public void GetReserveShould()
        {
            // Arrange
            DBEntities db = new DBEntities();

            ReservesController controller = new ReservesController();

            // Act
            IQueryable <Reserve> expected = db.Reserve;
            IQueryable <Reserve> actual   = controller.GetReserve();

            // Assert
            Assert.True(actual != null);
            Assert.Equal(expected.Count(), actual.Count());
        }