示例#1
0
        public SalaLogic()
        {
            Repo = new SalaRepository();
            var salas = Repo.Obtener();

            Sala = salas.First();
        }
        public void SalaRepositoryTestsTestSetUp()
        {
            BaseSqlTest.SeedDeleteDatabase();
            BaseSqlTest.SeedInsertDatabase();

            _salaRepository = new SalaRepository();
            _salaDefault    = SalaObjectMother.Default;
        }
示例#3
0
        static void Main()
        {
            var salas = new SalaRepository().Obtener();

            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new UI.EditarSala(new Logic.SalaLogic(salas.First())));
        }
示例#4
0
        public void Deve_informar_que_nao_existem_salas_disponiveis()
        {
            var salas          = new List <Sala>();
            var salaRepository = new SalaRepository(salas);
            var salaService    = new SalaService(salaRepository);

            var exception = Assert.Throws <ChatException>(() => salaService.Obter());

            Assert.Equal("Desculpe, não existem salas disponiveis.", exception.Message);
        }
示例#5
0
        public AdicionarParticipanteTest()
        {
            var sala  = new Sala("Sala1");
            var salas = new List <Sala> {
                sala
            };
            var salaReposioty = new SalaRepository(salas);

            _salaService = new SalaService(salaReposioty);
        }
示例#6
0
        public EnviarMensagemPublicaTest()
        {
            var sala  = new Sala("Sala1");
            var salas = new List <Sala> {
                sala
            };
            var salaReposioty = new SalaRepository(salas);

            _salaService = new SalaService(salaReposioty);
            _salaService.AdicionarParticipante("Sala1", "Pedro");
        }
示例#7
0
        public ObterMensagensDoParticipanteTest()
        {
            var sala = new Sala("Sala1");

            sala.AdicionarParticipante("Maria");
            sala.EnviarMensagemPublica("Bom dia pessoal", "Maria");

            var salas = new List <Sala> {
                sala
            };
            var salaReposioty = new SalaRepository(salas);

            _salaService = new SalaService(salaReposioty);
        }
示例#8
0
        public void Deve_obter_as_salas_disponiveis()
        {
            var salas = new List <Sala> {
                new Sala("Sala1"), new Sala("Sala2")
            };
            var salaRepository = new SalaRepository(salas);
            var salaService    = new SalaService(salaRepository);

            var salasEncontradas = salaService.Obter();

            Assert.Equal(2, salasEncontradas.Count);
            Assert.Contains(salasEncontradas, x => x.Nome == "Sala1");
            Assert.Contains(salasEncontradas, x => x.Nome == "Sala2");
        }
示例#9
0
 public EventoService()
 {
     repository     = new EventoRepository();
     salaRepository = new SalaRepository();
 }
示例#10
0
 public SalaLogic(Sala sala)
 {
     Repo = new SalaRepository();
     Sala = sala;
 }
示例#11
0
 public SalaRepositoryTest()
 {
     PegaContexto();
     _salaRepo = new SalaRepository(meuContexto);
 }
示例#12
0
 public SalaRepositoryTest()
 {
     _salaRepo = new SalaRepository(meuContexto);
 }
示例#13
0
        public List <Sala> Get()
        {
            var teste = new SalaRepository().GetAll().ToList();//.ToList();

            return(teste);
        }
示例#14
0
 public SalaService()
 {
     repository = new SalaRepository();
 }