Exemple #1
0
        public void Setup()
        {
            #region Mocks - comportamentos ficticios para a lógica de negócio
            Mock <IModulosServices> ModulosServices = new Mock <IModulosServices>();
            //Comportamento para criar o Doente
            ModulosServices.Setup(x => x.CreateAsync(
                                      It.IsAny <DataBase.Models.Modulos>(),
                                      CancellationToken.None
                                      )).ReturnsAsync(new DataBase.Models.Modulos()
            {
                Nome = "Diogo Biscaia"
            });

            ModulosServices.Setup(x => x.UpdateAsync(
                                      It.IsAny <int>(),
                                      It.IsAny <DataBase.Models.Modulos>(),
                                      CancellationToken.None
                                      )).ReturnsAsync(new DataBase.Models.Modulos()
            {
                Nome = "Diogo Biscaia"
            });

            ModulosServices.Setup(x => x.GetByIdAsync(
                                      It.IsAny <int>(),
                                      CancellationToken.None
                                      )).ReturnsAsync(new DataBase.Models.Modulos()
            {
                Nome = "Diogo Biscaia"
            });

            ModulosServices.Setup(x => x.GetAllAsync(
                                      CancellationToken.None
                                      )).ReturnsAsync(new List <DataBase.Models.Modulos>()
            {
                new DataBase.Models.Modulos()
                {
                    Nome = "Diogo Biscaia"
                }
            });

            ModulosServices.Setup(x => x.DeleteAsync(
                                      It.IsAny <int>(),
                                      CancellationToken.None
                                      ));
            #endregion
            gateway = new ModulosController(ModulosServices.Object);
        }
Exemple #2
0
        private BunifuFlatButton CriarButtonModulo(IModulos modulo)
        {
            BunifuFlatButton btnModulo = new BunifuFlatButton();

            btnModulo.Activecolor           = Color.Gray;
            btnModulo.BackColor             = Color.Transparent;
            btnModulo.BackgroundImageLayout = ImageLayout.Stretch;
            btnModulo.BorderRadius          = 0;
            btnModulo.ButtonText            = "   " + modulo.moduloTitle;
            btnModulo.Cursor                   = Cursors.Hand;
            btnModulo.DisabledColor            = Color.DimGray;
            btnModulo.Dock                     = DockStyle.Top;
            btnModulo.Iconcolor                = Color.Transparent;
            btnModulo.Iconimage                = modulo.img;
            btnModulo.Iconimage_right          = null;
            btnModulo.Iconimage_right_Selected = null;
            btnModulo.Iconimage_Selected       = null;
            btnModulo.IconMarginLeft           = 0;
            btnModulo.IconMarginRight          = 0;
            btnModulo.IconRightVisible         = true;
            btnModulo.IconRightZoom            = 0D;
            btnModulo.IconVisible              = true;
            btnModulo.IconZoom                 = 30D;
            btnModulo.IsTab                    = false;
            btnModulo.Location                 = new Point(0, 126);
            btnModulo.Name                     = "btn" + modulo.moduloTitle;
            btnModulo.Normalcolor              = Color.Transparent;
            btnModulo.OnHovercolor             = Color.Gray;
            btnModulo.OnHoverTextColor         = Color.White;
            btnModulo.selected                 = false;
            btnModulo.Size                     = new Size(244, 42);
            btnModulo.TabIndex                 = 3;
            btnModulo.Text                     = "   " + modulo.moduloTitle;
            btnModulo.TextAlign                = ContentAlignment.MiddleLeft;
            btnModulo.Textcolor                = Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
            btnModulo.TextFont                 = new Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            btnModulo.Click                   += delegate(object sender, EventArgs e) { AbrirUsercontrol(sender, e, modulo.moduloControl); };

            return(btnModulo);
        }