Ejemplo n.º 1
0
        public void NoIngresaNumeroLanzaExcepcion()
        {
            Library.BibliotecaPerfiles biblioteca = Library.BibliotecaPerfiles.Instance;
            biblioteca.CrearUsuario(0);
            Mensaje mensaje = new Mensaje("stub", 0, TipoPlataforma.Consola);
            ControlPrecioMaxStub control = new ControlPrecioMaxStub();

            BibliotecaPerfiles.GetUsuario(0).RegistroPreguntas.PrecioMax = true;

            control.Handle(mensaje);

            Assert.Throws <FormatException>(() => Int32.Parse(mensaje.Contenido));
        }
Ejemplo n.º 2
0
        public void SiPrecioMaxCorrectoSeteaPerfil()
        {
            Library.BibliotecaPerfiles biblioteca = Library.BibliotecaPerfiles.Instance;
            biblioteca.CrearUsuario(0);
            Mensaje mensaje = new Mensaje("25", 0, TipoPlataforma.Consola);
            ControlPrecioMaxStub control = new ControlPrecioMaxStub();

            BibliotecaPerfiles.GetUsuario(0).RegistroPreguntas.PrecioMax = true;

            control.Handle(mensaje);

            Assert.AreEqual(BibliotecaPerfiles.GetUsuario(0).PrecioMax, 25);
        }
Ejemplo n.º 3
0
        public void SiTodoOKContinuoASiguienteEslabon()
        {
            Library.BibliotecaPerfiles biblioteca = Library.BibliotecaPerfiles.Instance;
            biblioteca.CrearUsuario(0);
            Mensaje mensaje = new Mensaje("25", 0, TipoPlataforma.Consola);
            ControlPrecioMaxStub control = new ControlPrecioMaxStub();

            BibliotecaPerfiles.GetUsuario(0).RegistroPreguntas.PrecioMax = true;

            control.Handle(mensaje);

            Assert.AreEqual(BibliotecaPerfiles.GetUsuario(0).PrecioMax, 25);

            Assert.IsTrue(control.passed);
        }