示例#1
0
        public void NewAgilistaStoresTwitter()
        {
            var category = new Category("cat");
            var agilista = new Agilista("a", category, "@t");

            Assert.Equal("@t", agilista.TwitterHandle);
        }
示例#2
0
        public void NewAgilistaStoresCategory()
        {
            var category = new Category("cat");
            var agilista = new Agilista("a", category);

            Assert.Equal("cat", agilista.PrimaryFocus.Description);
        }
示例#3
0
        public async Task <ActionResult <Agilista> > PostAgilista(Agilista Agilista)
        {
            _context.Agilistas.Add(Agilista);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetAgilista", new { id = Agilista.Id }, Agilista));
        }
示例#4
0
        public void NewAgilistaHasGuid()
        {
            var category = new Category("cat");
            var agilista = new Agilista("a", category);

            Assert.NotEqual(Guid.Empty, agilista.Id);
        }
示例#5
0
        public async Task <IActionResult> PutAgilista(Guid id, Agilista Agilista)
        {
            if (id != Agilista.Id)
            {
                return(BadRequest());
            }

            _context.Entry(Agilista).State = EntityState.Modified;

            try {
                await _context.SaveChangesAsync();
            } catch (DbUpdateConcurrencyException) {
                if (!AgilistaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }