Ejemplo n.º 1
0
        public ActionResult Execute(string text)
        {
            var collection          = new MockCollection(text);
            var mocks               = collection.Get();
            List <MockModel> result = new List <MockModel>();

            foreach (var mock in mocks)
            {
                var m        = mock.Get();
                var executor = new MockExecutor(m);
                result = executor.PerformAction();
            }
            return(JsonSuccess(result));
        }
Ejemplo n.º 2
0
        public ActionResult ExecuteVoice(string fileName)
        {
            var filePath = Path.Combine(Path.GetDirectoryName(MockApp.tdb), fileName);

            using (var fs = new FileStream(filePath, FileMode.Open))
            {
                var collection          = new MockCollection(fs);
                var mocks               = collection.Get();
                List <MockModel> result = new List <MockModel>();
                foreach (var mock in mocks)
                {
                    var m        = mock.Get();
                    var executor = new MockExecutor(m);
                    result = executor.PerformAction();
                }
                return(JsonSuccess(result));
            }
        }