Esempio n. 1
0
        public void PrestarLibroTest()
        {
            // Arrange
            Libro libro = new LibroTestDataBuilder().ConTitulo(CRONICA_UNA_MUERTE_ANUNCIADA).Build();

            repositorioLibro.Agregar(libro);
            Bibliotecario bibliotecario = new Bibliotecario(repositorioLibro, repositorioPrestamo);

            // Act
            bibliotecario.Prestar(libro.Isbn, "Juan");

            // Assert
            Assert.AreEqual(bibliotecario.EsPrestado(libro.Isbn), true);
            Assert.IsNotNull(repositorioPrestamo.ObtenerLibroPrestadoPorIsbn(libro.Isbn));
        }
Esempio n. 2
0
        public void PrestarLibroTest()
        {
            var libro = new LibroTestDataBuilder().ConTitulo(CRONICAUNAMUERTEANUNCIADA).Build();

            _repositorioLibro.Agregar(libro);
            var bibliotecario = new Bibliotecario(_repositorioLibro, _repositorioPrestamo);

            bibliotecario.Prestar(libro.Isbn, "AlbertoPalencia");
            Assert.AreEqual(bibliotecario.EsPrestado(libro.Isbn), true);
            Assert.IsNotNull(_repositorioPrestamo.ObtenerLibroPrestadoPorIsbn(libro.Isbn));
        }