Exemplo n.º 1
0
        public void Test_SupplierNotFound()
        {
            var controller = new SUPPLIERsController();
            IHttpActionResult actionResult = controller.GetSUPPLIER("100");

            Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetSUPPLIERTest([PexAssumeUnderTest] SUPPLIERsController target, string id)
        {
            IHttpActionResult result = target.GetSUPPLIER(id);

            return(result);
            // TODO: add assertions to method SUPPLIERsControllerTest.GetSUPPLIERTest(SUPPLIERsController, String)
        }
        public void GetSuppliersByNo_ShouldReturnSelectedSupplier()
        {
            var testSuppliers = GetTestSuppliers();

            mockSupplierRepository.Setup(s => s.GetSupplierById(It.IsAny <string>())).Returns(Task.FromResult(testSuppliers[1]).Result);
            var result = controller.GetSUPPLIER("2") as OkNegotiatedContentResult <SupplierModel>;

            Assert.AreEqual(testSuppliers[1].SUPLNO, result.Content.SUPLNO);
        }
Exemplo n.º 4
0
        public void Test_SupplierBasedOnID()
        {
            string supplierid = "1";
            // var supplier = GetSUPPLIERs().Find(x => x.SUPLNO == supplierid);
            var SC = new SUPPLIERsController();

            var res = SC.GetSUPPLIER(supplierid);
            var ct  = res as OkNegotiatedContentResult <SUPPLIER>;

            Assert.IsNotNull(ct);
            Assert.IsNotNull(ct.Content);
            Assert.AreEqual("1", ct.Content.SUPLNO.Trim());
        }