Example #1
0
        public void GetBookById_Test()
        {
            Assert.True(lib != null);
            BookDTO b = lib.Get("11111c9e46f8a5acf7df2af0"); // Id no existe en BBDD

            Assert.True(b == null);
            b = lib.Get("5ed23c9e46f8a5acf7df2af0");
            Assert.True(b != null && b.BookName == "Las estrellas son legiĆ³n");
        }
Example #2
0
        public void ConnectDB_ErrorInConnString_Test()
        {
            LibraryDAO lib = new LibraryDAO("mongodb://localhostdfsf:27017", "Library", "Books");

            Assert.Throws <System.TimeoutException>(() => lib.Get("5ed23c9e46f8a5acf7df2af0"));
        }