Exemple #1
0
        public async Task Controller_GET()
        {
            var controller = new TypeController(Manager, User);

            var mdl = await controller.PostAsync(new TypeCreate()
            {
                Name = "test"
            }) as JsonResult;

            var obj = mdl.Value as Models.Output.Symbols.Type;

            Assert.AreEqual(1, obj.Id);
            Assert.AreEqual("test", obj.Name);

            var res   = controller.AllTypes() as JsonResult;
            var types = res.Value as IEnumerable <Models.Output.Symbols.Type>;

            Assert.AreEqual(1, types.Count());
            Assert.AreEqual("test", types.First().Name);
        }