Exemplo n.º 1
0
        public async void ReturnCorrectView()
        {
            var result = await sut.Index("", 5);

            var vr = Assert.IsType <ViewResult>(result);

            Assert.Equal("Index", vr.ViewName);
        }
Exemplo n.º 2
0
 public void saleindex()
 {
     using (var controller = new SaleController())
     {
         _result = controller.Index();
     }
 }
Exemplo n.º 3
0
        public void Index_ValidPostedFileButReturnedSalesList_ReturnNotNull()
        {
            // Arrange
            HttpPostedFileBase httpPostedFile = Mock.Of <HttpPostedFileBase>();
            var mock = Mock.Get(httpPostedFile);

            mock.Setup(_ => _.FileName).Returns("fakeFileName.extension");

            using (var memoryStream = new MemoryStream())
            {
                //...populate fake stream
                //setup mock to return stream
                mock.Setup(_ => _.InputStream).Returns(memoryStream);

                _dummySales = null;
                _blSale.Setup(fr => fr.GetSales(It.IsAny <Stream>())).Returns(_dummySales);
                var controller = new SaleController(_blSale.Object);

                // Act
                var result = controller.Index(httpPostedFile);

                // Assert
                Assert.IsNotNull(result);
            }
        }
Exemplo n.º 4
0
        public void Showlistapproved()
        {
            var db       = new K21T1_Team4Entities1();
            var viewlist = db.PROPERTies.OrderByDescending(m => m.Create_post).Where(p => p.PROJECT_STATUS.Status_Name == "Đã duyệt" || p.PROJECT_STATUS.Status_Name == "Hết hạn").ToList();

            using (var controller = new SaleController())
            {
                _result = controller.Index();
            }
        }
Exemplo n.º 5
0
        public void Index_ValidSalesList_ReturnNotNull()
        {
            // Arrange
            _blSale.Setup(fr => fr.GetSales(It.IsAny <Stream>())).Returns(_dummySales);
            var controller = new SaleController(_blSale.Object);

            // Act
            var result = controller.Index();

            // Assert
            Assert.IsNotNull(result);
        }