public void IncluiUmNovoEstiloMusical()
        {
            var estiloMusical = new EstiloMusical
            {
                Nome = "Heavy Metal",
                Descricao = "Heavy Metal"
            };

            var mongoDb = new Models.MongoDB();
            mongoDb.Incluir(estiloMusical);

            Assert.IsNotNull(estiloMusical.Id);
        }
Beispiel #2
0
        public void IncluiUmNovoEstiloMusical()
        {
            var estiloMusical = new EstiloMusical
            {
                Nome      = "Heavy Metal",
                Descricao = "Heavy Metal"
            };

            var mongoDb = new Models.MongoDB();

            mongoDb.Incluir(estiloMusical);

            Assert.IsNotNull(estiloMusical.Id);
        }
        public ActionResult Incluir(EstiloMusical estiloMusical)
        {
            try
            {
                // TODO: Add insert logic here
                mongoDb.Incluir(estiloMusical);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #4
0
        public void IncluiUmNovoAlbum()
        {
            var mongoDb       = new Models.MongoDB();
            var estiloMusical = mongoDb.Obter <EstiloMusical>(e => e.Nome == "Heavy Metal");

            var album = new Album
            {
                EstiloMusical = new DbReference <EstiloMusical>(estiloMusical.Id),
                Nome          = "Powerslave"
            };

            mongoDb.Incluir(album);

            Assert.IsNotNull(album.IdAlbum);
        }
        public void IncluiUmNovoAlbum()
        {
            var mongoDb = new Models.MongoDB();
            var estiloMusical = mongoDb.Obter<EstiloMusical>(e => e.Nome == "Heavy Metal");

            var album = new Album
                            {
                                EstiloMusical = new DbReference<EstiloMusical>(estiloMusical.Id),
                                Nome = "Powerslave"
                            };

            mongoDb.Incluir(album);

            Assert.IsNotNull(album.IdAlbum);
        }