示例#1
0
        public async Task Controller_GetById()
        {
            var smanager = new SymbolManager(Context, new Config()
            {
                MaxSymsPerPage = 15
            });
            var controller = new ExampleController(User, new ExampleModule(Context), smanager);
            var sym        = await PostTestSymbol(new Symbols.SymbolController(smanager, User));

            await PostTestExample(sym);

            var res = await controller.GetAsync(1) as JsonResult;

            var obj = res.Value as Models.Output.Examples.Example;

            Assert.AreEqual(1, obj.Id);
            Assert.AreEqual("This is a test example", obj.Description);
        }