Пример #1
0
        public void TestCreateNotNull()
        {
            FormulariosController formulario = new FormulariosController();
            ViewResult            result     = formulario.Create() as ViewResult;

            Assert.IsNotNull(result);
        }
Пример #2
0
        public void TestCreateView()
        {
            FormulariosController formulario = new FormulariosController();
            ViewResult            result     = formulario.Create() as ViewResult;

            Assert.AreEqual("Create", result.ViewName);
        }
Пример #3
0
        public void TestCreateSuccesful()
        {
            var        mockDb        = new Mock <DataIntegradorEntities>();
            string     codFormulario = "CI0128G2";
            Formulario formulario    = new Formulario()
            {
                Codigo = codFormulario,
                Nombre = "Formularios de prueba para CI0128"
            };

            mockDb.Setup(m => m.Formulario.Find(codFormulario)).Returns(formulario);

            FormulariosController controller = new FormulariosController(mockDb.Object);
            var result = controller.Create(formulario, 1);

            Assert.IsNotNull(result);
        }